@@ -674,20 +674,41 @@ async def ping(self, ctx):
674
674
675
675
@commands .command ()
676
676
@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 ]):
678
678
"""
679
679
Change what the bot mentions at the start of each thread.
680
680
681
681
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.
682
684
"""
683
- # TODO: ability to disable mention.
684
685
current = self .bot .config ["mention" ]
685
-
686
686
if not mention :
687
687
embed = discord .Embed (
688
688
title = "Current mention:" , color = self .bot .main_color , description = str (current )
689
689
)
690
+ elif (
691
+ len (mention ) == 1
692
+ and isinstance (mention [0 ], str )
693
+ and mention [0 ] in ["disable" , "reset" ]
694
+ ):
695
+ option = mention [0 ]
696
+ if option == "disable" :
697
+ embed = discord .Embed (
698
+ description = f"Disabled mention on thread creation." ,
699
+ color = self .bot .main_color ,
700
+ )
701
+ self .bot .config ["mention" ] = None
702
+ else :
703
+ embed = discord .Embed (
704
+ description = "`mention` had been reset to default." , color = self .bot .main_color ,
705
+ )
706
+ self .bot .config .remove ("mention" )
707
+ await self .bot .config .update ()
690
708
else :
709
+ for m in mention :
710
+ if not isinstance (m , (discord .Role , discord .Member )):
711
+ raise commands .BadArgument (f'Role or Member "{ m } " not found.' )
691
712
mention = " " .join (i .mention for i in mention )
692
713
embed = discord .Embed (
693
714
title = "Changed mention!" ,
0 commit comments