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

rocketbot.py 897B

123456789101112131415161718192021222324252627
  1. """
  2. Rocketbot Discord bot. Relies on a configured config.py (copy config.py.sample for a template) and
  3. the sqlite database rocketbot.db (copy rocketbot.db.sample for a blank database).
  4. Author: Ian Albert (@rocketsoup)
  5. Date: 2021-11-11
  6. """
  7. from discord import Intents
  8. from discord.ext import commands
  9. from config import CONFIG
  10. from cogs.configcog import ConfigCog
  11. from cogs.generalcog import GeneralCog
  12. from cogs.joinraidcog import JoinRaidCog
  13. class Rocketbot(commands.Bot):
  14. def __init__(self, command_prefix, **kwargs):
  15. super().__init__(command_prefix, **kwargs)
  16. intents = Intents.default()
  17. intents.members = True # To get join/leave events
  18. bot = Rocketbot(command_prefix=CONFIG['commandPrefix'], intents=intents)
  19. bot.add_cog(GeneralCog(bot))
  20. bot.add_cog(ConfigCog(bot))
  21. bot.add_cog(JoinRaidCog(bot))
  22. bot.run(CONFIG['clientToken'], bot=True, reconnect=True)
  23. print('\nBot aborted')