Experimental Discord bot written in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rocketbot.py 921B

12345678910111213141516171819202122232425262728
  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.messages = True
  18. intents.members = True # To get join/leave events
  19. bot = Rocketbot(command_prefix=CONFIG['commandPrefix'], intents=intents)
  20. bot.add_cog(GeneralCog(bot))
  21. bot.add_cog(ConfigCog(bot))
  22. bot.add_cog(JoinRaidCog(bot))
  23. bot.run(CONFIG['clientToken'], bot=True, reconnect=True)
  24. print('\nBot aborted')