@@ -673,25 +673,37 @@ async def ping(self, ctx):
673
673
674
674
@commands .command ()
675
675
@checks .has_permissions (PermissionLevel .ADMINISTRATOR )
676
- async def mention (self , ctx , * mention : Union [discord .Role , discord .Member , str ]):
676
+ async def mention (self , ctx , * user_or_role : Union [discord .Role , discord .Member , str ]):
677
677
"""
678
678
Change what the bot mentions at the start of each thread.
679
679
680
- Type only `{prefix}mention` to retrieve your current "mention" message.
681
- `{prefix}mention disable` to disable mention.
682
- `{prefix}mention reset` to reset it to default value.
680
+ `user_or_role` may be a user ID, mention, name, role ID, mention, or name.
681
+ You can also set it to mention multiple users or roles, just separate the arguments with space.
682
+
683
+ Examples:
684
+ - `{prefix}mention @user`
685
+ - `{prefix}mention @user @role`
686
+ - `{prefix}mention 984301093849028 388218663326449`
687
+ - `{prefix}mention everyone`
688
+
689
+ Do not ping `@everyone` to set mention to everyone, use "everyone" or "all" instead.
690
+
691
+ Notes:
692
+ - Type only `{prefix}mention` to retrieve your current "mention" message.
693
+ - `{prefix}mention disable` to disable mention.
694
+ - `{prefix}mention reset` to reset it to default value, which is "@here".
683
695
"""
684
696
current = self .bot .config ["mention" ]
685
- if not mention :
697
+ if not user_or_role :
686
698
embed = discord .Embed (
687
699
title = "Current mention:" , color = self .bot .main_color , description = str (current )
688
700
)
689
701
elif (
690
- len (mention ) == 1
691
- and isinstance (mention [0 ], str )
692
- and mention [0 ].lower () in [ "disable" , "reset" ]
702
+ len (user_or_role ) == 1
703
+ and isinstance (user_or_role [0 ], str )
704
+ and user_or_role [0 ].lower () in ( "disable" , "reset" )
693
705
):
694
- option = mention [0 ].lower ()
706
+ option = user_or_role [0 ].lower ()
695
707
if option == "disable" :
696
708
embed = discord .Embed (
697
709
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])
704
716
self .bot .config .remove ("mention" )
705
717
await self .bot .config .update ()
706
718
else :
707
- for m in mention :
708
- if not isinstance (m , (discord .Role , discord .Member )):
719
+ mention = []
720
+ everyone = ("all" , "everyone" )
721
+ for m in user_or_role :
722
+ if not isinstance (m , (discord .Role , discord .Member )) and m not in everyone :
709
723
raise commands .BadArgument (f'Role or Member "{ m } " not found.' )
710
- mention = " " .join (i .mention for i in mention )
724
+ elif m == ctx .guild .default_role or m in everyone :
725
+ mention .append ("@everyone" )
726
+ continue
727
+ mention .append (m .mention )
728
+
729
+ mention = " " .join (mention )
711
730
embed = discord .Embed (
712
731
title = "Changed mention!" ,
713
732
description = f'On thread creation the bot now says "{ mention } ".' ,
0 commit comments