| 123456789101112131415161718192021222324 |
- from discord.ext import commands
- from cogs.base import BaseCog
-
- class GeneralCog(BaseCog):
- def __init__(self, bot: commands.Bot):
- self.bot = bot
- self.is_connected = False
- self.is_ready = False
-
- @commands.Cog.listener()
- async def on_connect(self):
- print('on_connect')
- self.is_connected = True
-
- @commands.Cog.listener()
- async def on_ready(self):
- print('on_ready')
- self.is_ready = True
-
- @commands.command()
- @commands.has_permissions(ban_members=True)
- @commands.guild_only()
- async def testwarn(self, context):
- await self.warn(context.guild, 'Test warning')
|