Skip to content

Commit f8982cf

Browse files
committed
Merge branch 'Jerrie-Aries-dev-01' into development
2 parents 41d5593 + ae88073 commit f8982cf

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

cogs/modmail.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ async def move(self, ctx, *, arguments):
341341

342342
if self.bot.config["thread_move_notify_mods"]:
343343
mention = self.bot.config["mention"]
344-
await thread.channel.send(f"{mention}, thread has been moved.")
344+
if mention is not None:
345+
msg = f"{mention}, thread has been moved."
346+
else:
347+
msg = "Thread has been moved."
348+
await thread.channel.send(msg)
345349

346350
sent_emoji, _ = await self.bot.retrieve_emoji()
347351
await self.bot.add_reaction(ctx.message, sent_emoji)

cogs/utility.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,20 +674,40 @@ async def ping(self, ctx):
674674

675675
@commands.command()
676676
@checks.has_permissions(PermissionLevel.ADMINISTRATOR)
677-
async def mention(self, ctx, *mention: Union[discord.Role, discord.Member]):
677+
async def mention(self, ctx, *mention: Union[discord.Role, discord.Member, str]):
678678
"""
679679
Change what the bot mentions at the start of each thread.
680680
681681
Type only `{prefix}mention` to retrieve your current "mention" message.
682+
`{prefix}mention disable` to disable mention.
683+
`{prefix}mention reset` to reset it to default value.
682684
"""
683-
# TODO: ability to disable mention.
684685
current = self.bot.config["mention"]
685-
686686
if not mention:
687687
embed = discord.Embed(
688688
title="Current mention:", color=self.bot.main_color, description=str(current)
689689
)
690+
elif (
691+
len(mention) == 1
692+
and isinstance(mention[0], str)
693+
and mention[0].lower() in ["disable", "reset"]
694+
):
695+
option = mention[0].lower()
696+
if option == "disable":
697+
embed = discord.Embed(
698+
description=f"Disabled mention on thread creation.", color=self.bot.main_color,
699+
)
700+
self.bot.config["mention"] = None
701+
else:
702+
embed = discord.Embed(
703+
description="`mention` is reset to default.", color=self.bot.main_color,
704+
)
705+
self.bot.config.remove("mention")
706+
await self.bot.config.update()
690707
else:
708+
for m in mention:
709+
if not isinstance(m, (discord.Role, discord.Member)):
710+
raise commands.BadArgument(f'Role or Member "{m}" not found.')
691711
mention = " ".join(i.mention for i in mention)
692712
embed = discord.Embed(
693713
title="Changed mention!",

0 commit comments

Comments
 (0)