aboutsummaryrefslogtreecommitdiff
path: root/utils.py
blob: 86f7101c7b237b570a5dbdecbf1041fb4dec410b (plain)
1
2
3
4
5
6
7
8
9
10
import os
from discord.ext.commands import Bot


def load_all_modules(bot: Bot, module_folder='modules', module_package=None):
    if module_package is None:
        module_package = module_folder.replace('/', '.')
    for module in sorted(os.listdir(module_folder)):
        if module.endswith('.py') and not module.startswith('_'):
            bot.load_extension(module_package + '.' + module[:-3])