Merge pull request #15 from iakrules/Subfolders

+subfolders
This commit is contained in:
ishaan 2021-06-07 21:47:59 -04:00 committed by GitHub
commit 45b53b28f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

25
bot.py
View file

@ -21,8 +21,29 @@ async def load(ctx, extension):
async def unload(ctx, extension): async def unload(ctx, extension):
client.unload_extension(f'cogs.{extension}') client.unload_extension(f'cogs.{extension}')
for filename in os.listdir('./cogs'): # Subfolders
for filename in os.listdir('./cogs/fun'):
if filename.endswith('.py'): if filename.endswith('.py'):
client.load_extension(f'cogs.{filename[:-3]}') client.load_extension(f'cogs.music.{filename[:-3]}')
for filename in os.listdir('./cogs/general'):
if filename.endswith('.py'):
client.load_extension(f'cogs.general.{filename[:-3]}')
for filename in os.listdir('./cogs/info'):
if filename.endswith('.py'):
client.load_extension(f'cogs.music.{filename[:-3]}')
for filename in os.listdir('./cogs/moderation'):
if filename.endswith('.py'):
client.load_extension(f'cogs.moderation.{filename[:-3]}')
for filename in os.listdir('./cogs/music'):
if filename.endswith('.py'):
client.load_extension(f'cogs.music.{filename[:-3]}')
for filename in os.listdir('./cogs/owner'):
if filename.endswith('.py'):
client.load_extension(f'cogs.music.{filename[:-3]}')
client.run(TOKEN) client.run(TOKEN)