aboutsummaryrefslogtreecommitdiff
path: root/util.py
blob: cf801093024ac3dba095f6dba97c47e4ab813e4e (plain)
1
2
3
4
5
6
7
8
9
10
11
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 os.listdir(module_folder):
        if module.endswith('.py') and not module.startswith('_'):
            bot.load_extension(module_package + '.' + module[:-3])