@@ -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