aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorromangraef <romangraef@loves.dicksinhisan.us>2018-08-21 16:12:39 +0200
committerromangraef <romangraef@loves.dicksinhisan.us>2018-08-21 16:12:39 +0200
commita4c058b5c0ec4e441c63ae2ef15235a4869d2bac (patch)
tree64a039e55976adace41fb56d4fc77e88333db802 /utils.py
downloadnotaselfbotv2finalforsure-a4c058b5c0ec4e441c63ae2ef15235a4869d2bac.tar.gz
notaselfbotv2finalforsure-a4c058b5c0ec4e441c63ae2ef15235a4869d2bac.tar.bz2
notaselfbotv2finalforsure-a4c058b5c0ec4e441c63ae2ef15235a4869d2bac.zip
Initial commit
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.py b/utils.py
new file mode 100644
index 0000000..86f7101
--- /dev/null
+++ b/utils.py
@@ -0,0 +1,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])