diff --git a/cogs/utility.py b/cogs/utility.py index 8ce7af5b69..7b39631dcd 100644 --- a/cogs/utility.py +++ b/cogs/utility.py @@ -673,25 +673,37 @@ async def ping(self, ctx): @commands.command() @checks.has_permissions(PermissionLevel.ADMINISTRATOR) - async def mention(self, ctx, *mention: Union[discord.Role, discord.Member, str]): + async def mention(self, ctx, *user_or_role: Union[discord.Role, discord.Member, str]): """ Change what the bot mentions at the start of each thread. - Type only `{prefix}mention` to retrieve your current "mention" message. - `{prefix}mention disable` to disable mention. - `{prefix}mention reset` to reset it to default value. + `user_or_role` may be a user ID, mention, name, role ID, mention, or name. + You can also set it to mention multiple users or roles, just separate the arguments with space. + + Examples: + - `{prefix}mention @user` + - `{prefix}mention @user @role` + - `{prefix}mention 984301093849028 388218663326449` + - `{prefix}mention everyone` + + Do not ping `@everyone` to set mention to everyone, use "everyone" or "all" instead. + + Notes: + - Type only `{prefix}mention` to retrieve your current "mention" message. + - `{prefix}mention disable` to disable mention. + - `{prefix}mention reset` to reset it to default value, which is "@here". """ current = self.bot.config["mention"] - if not mention: + if not user_or_role: embed = discord.Embed( title="Current mention:", color=self.bot.main_color, description=str(current) ) elif ( - len(mention) == 1 - and isinstance(mention[0], str) - and mention[0].lower() in ["disable", "reset"] + len(user_or_role) == 1 + and isinstance(user_or_role[0], str) + and user_or_role[0].lower() in ("disable", "reset") ): - option = mention[0].lower() + option = user_or_role[0].lower() if option == "disable": embed = discord.Embed( description=f"Disabled mention on thread creation.", color=self.bot.main_color, @@ -704,10 +716,17 @@ async def mention(self, ctx, *mention: Union[discord.Role, discord.Member, str]) self.bot.config.remove("mention") await self.bot.config.update() else: - for m in mention: - if not isinstance(m, (discord.Role, discord.Member)): + mention = [] + everyone = ("all", "everyone") + for m in user_or_role: + if not isinstance(m, (discord.Role, discord.Member)) and m not in everyone: raise commands.BadArgument(f'Role or Member "{m}" not found.') - mention = " ".join(i.mention for i in mention) + elif m == ctx.guild.default_role or m in everyone: + mention.append("@everyone") + continue + mention.append(m.mention) + + mention = " ".join(mention) embed = discord.Embed( title="Changed mention!", description=f'On thread creation the bot now says "{mention}".', diff --git a/core/config_help.json b/core/config_help.json index e764c9255d..d430b9ee4c 100644 --- a/core/config_help.json +++ b/core/config_help.json @@ -52,7 +52,8 @@ "`{prefix}mention Yo~ Here's a new thread for ya!`" ], "notes": [ - "Unfortunately, it's not currently possible to disable mention. You do not have to include a mention." + "To disable mention, use command `{prefix}mention disable`.", + "See also: `{prefix}help mention`." ] }, "main_color": {