dashwav / yin-bot

Discord bot with a focus on moderation. Written in discord.py
https://dashwav.github.io/yin-bot/
MIT License
12 stars 8 forks source link

Reorganize run.py to import and run cogs in alphabetical order #64

Closed dashwav closed 4 years ago

dashwav commented 5 years ago

This is unironically something that always bothers me

ShadowDogger commented 5 years ago

run.py will be cleaned by me.

nickstarform commented 5 years ago

tbh, I think it could be handled more pythonically. Like just importing the cog module and looping through it or listing out all the cogs and then looping through. Will cut back on some of the repetitive nature. Something like this

initial_extensions = ['owner',
                      'general',
                      'moderation',
                      'administration',
                      'blacklist',
                      'logging']
    for cog in initial_extensions:
        bot.load_extension('cog.' + cog)
pandaxtc commented 5 years ago

The list of extensions to load could be in config.yml, which might be better than hard-coding them.