Experimental Discord bot written in Python
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324
  1. from discord.ext import commands
  2. from cogs.base import BaseCog
  3. class GeneralCog(BaseCog):
  4. def __init__(self, bot: commands.Bot):
  5. self.bot = bot
  6. self.is_connected = False
  7. self.is_ready = False
  8. @commands.Cog.listener()
  9. async def on_connect(self):
  10. print('on_connect')
  11. self.is_connected = True
  12. @commands.Cog.listener()
  13. async def on_ready(self):
  14. print('on_ready')
  15. self.is_ready = True
  16. @commands.command()
  17. @commands.has_permissions(ban_members=True)
  18. @commands.guild_only()
  19. async def testwarn(self, context):
  20. await self.warn(context.guild, 'Test warning')