Experimental Discord bot written in Python
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

general.py 377B

1234567891011121314151617
  1. from discord.ext import commands
  2. class GeneralCog(commands.Cog):
  3. def __init__(self, bot: commands.Bot):
  4. self.bot = bot
  5. self.is_connected = False
  6. self.is_ready = False
  7. @commands.Cog.listener()
  8. async def on_connect(self):
  9. print('on_connect')
  10. self.is_connected = True
  11. @commands.Cog.listener()
  12. async def on_ready(self):
  13. print('on_ready')
  14. self.is_ready = True