Skip to content

Instantly share code, notes, and snippets.

@victorbnl
Last active August 26, 2021 16:04
Show Gist options
  • Save victorbnl/a51c5cc1da146b5e705b6915f1080971 to your computer and use it in GitHub Desktop.
Save victorbnl/a51c5cc1da146b5e705b6915f1080971 to your computer and use it in GitHub Desktop.
Load all cogs of cogs folder
import os
import re
for f in os.listdir("cogs"):
if re.match(r".*\.py.swp", f):
pass
elif re.match(r".*\.py", f):
bot.load_extension("cogs." + f.replace(".py", ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment