Experimental Discord bot written in Python
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

main.py 962B

123456789101112131415161718192021222324252627
  1. """
  2. Rocketbot Discord bot. Relies on a configured config.py (copy config.sample.py
  3. for a template).
  4. Author: Ian Albert (@rocketsoup)
  5. Date: 2021-11-11
  6. """
  7. import asyncio
  8. from config import CONFIG
  9. from rocketbot.bot import start_bot
  10. from rocketbot.utils import bot_log
  11. CURRENT_CONFIG_VERSION = 3
  12. if (CONFIG.get('__config_version') or 0) < CURRENT_CONFIG_VERSION:
  13. # If you're getting this error, it means something changed in config.py's
  14. # format. Consult config.sample.py and compare it to your own config.py.
  15. # Rename/move any values as needed. When satisfied, update "__config_version"
  16. # to the value in config.sample.py. ...I know, pretty janky migration process.
  17. raise RuntimeError('config.py format may be outdated. Review ' +
  18. 'config.sample.py, update the "__config_version" field to ' +
  19. f'{CURRENT_CONFIG_VERSION}, and try again.')
  20. try:
  21. asyncio.run(start_bot())
  22. except KeyboardInterrupt:
  23. bot_log(None, None, 'Stopping bot due to Ctrl+C key')