@@ -47,6 +47,8 @@ async def modset_showsettings(self, ctx: commands.Context):
4747 delete_delay = data ["delete_delay" ]
4848 reinvite_on_unban = data ["reinvite_on_unban" ]
4949 dm_on_kickban = data ["dm_on_kickban" ]
50+ ban_message = data ["ban_message" ]
51+ show_user_id = data ["show_user_id" ]
5052 default_days = data ["default_days" ]
5153 default_tempban_duration = data ["default_tempban_duration" ]
5254 if not track_all_names and track_nicknames :
@@ -93,6 +95,12 @@ async def modset_showsettings(self, ctx: commands.Context):
9395 msg += _ ("Send message to users on kick/ban: {yes_or_no}\n " ).format (
9496 yes_or_no = _ ("Yes" ) if dm_on_kickban else _ ("No" )
9597 )
98+ msg += _ ("Ban Message: {ban_message}\n " ).format (
99+ ban_message = ban_message if ban_message else _ ("None" )
100+ )
101+ msg += _ ("Show User ID: {yes_or_no}\n " ).format (
102+ yes_or_no = _ ("Yes" ) if show_user_id else _ ("No" )
103+ )
96104 if default_days :
97105 msg += _ ("Default message history delete on ban: Previous {num_days} days\n " ).format (
98106 num_days = default_days
@@ -371,6 +379,44 @@ async def dm(self, ctx: commands.Context, enabled: bool = None):
371379 _ ("Bot will no longer attempt to send a DM to user before kick and ban." )
372380 )
373381
382+ @modset .command ()
383+ @commands .guild_only ()
384+ async def banmessage (self , ctx : commands .Context , * , message : str = None ):
385+ """Ban Message
386+
387+ Use it without message arg to clear
388+ """
389+ guild = ctx .guild
390+ if message is None :
391+ await self .config .guild (guild ).ban_message .set (None )
392+ await ctx .send (
393+ _ ("Ban message changed to default." )
394+ )
395+ return
396+ else :
397+ await self .config .guild (guild ).ban_message .set (message )
398+ await ctx .send (_ ("Ban message set to `{}`" ).format (message ))
399+
400+ @modset .command ()
401+ @commands .guild_only ()
402+ async def showid (self , ctx : commands .Context , enabled : bool = None ):
403+ """Toggle whether user id should be sent on ban message
404+ """
405+ guild = ctx .guild
406+ if enabled is None :
407+ setting = await self .config .guild (guild ).show_user_id ()
408+ await ctx .send (
409+ _ ("Show user id on ban is currently set to: {setting}" ).format (setting = setting )
410+ )
411+ return
412+ await self .config .guild (guild ).show_user_id .set (enabled )
413+ if enabled :
414+ await ctx .send (_ ("Bot will now send user id on ban." ))
415+ else :
416+ await ctx .send (
417+ _ ("Bot will no longer send user id on ban." )
418+ )
419+
374420 @modset .command ()
375421 @commands .guild_only ()
376422 async def defaultdays (self , ctx : commands .Context , days : int = 0 ):
0 commit comments