original_docstring: Close all threads and disable modmail.
docstring: Close all threads and disable modmail.
docstring_tokens: Close all threads and disable modmail .
code: async def disable(self, ctx, delete_archives: bool=False):
          """Close all threads and disable modmail."""
          categ = discord.utils.get(ctx.guild.categories, name='Mod Mail')
          archives = discord.utils.get(ctx.guild.categories, name='Mod Mail Archives')
          if not categ:
              return await ctx.send('This server is not set up.')
          em = discord.Embed(title='Thread Closed')
          em.description = f'**{ctx.author}** has closed this modmail session.'
          em.color = discord.Color.red()
          for category, channels in ctx.guild.by_category():
              if category == categ:
                  for chan in channels:
                      await chan.delete()
          await categ.delete()
          if delete_archives:
              await archives.delete()
          await ctx.send('Disabled modmail.')
code_tokens: async def disable ( self , ctx , delete_archives : bool = False ) : categ = discord . utils . get ( ctx . guild . categories , name = 'Mod Mail' ) archives = discord . utils . get ( ctx . guild . categories , name = 'Mod Mail Archives' ) if not categ : return await ctx . send ( 'This server is not set up.' ) em = discord . Embed ( title = 'Thread Closed' ) em . description = f'**{ctx.author}** has closed this modmail session.' em . color = discord . Color . red ( ) for category , channels in ctx . guild . by_category ( ) : if category == categ : for chan in channels : await chan . delete ( ) await categ . delete ( ) if delete_archives : await archives . delete ( ) await ctx . send ( 'Disabled modmail.' )
short_docstring: Close all threads and disable modmail.
short_docstring_tokens: Close all threads and disable modmail .
comment: """Close all threads and disable modmail."""