Style: move commands up
Commands should be declared before loading further extensions
This commit is contained in:
parent
91f96ce246
commit
b8b8484466
10
src/bot.py
10
src/bot.py
|
@ -24,10 +24,6 @@ if TOKEN is None:
|
||||||
|
|
||||||
bot = commands.Bot(command_prefix=commands.when_mentioned_or('$b '))
|
bot = commands.Bot(command_prefix=commands.when_mentioned_or('$b '))
|
||||||
|
|
||||||
default_extensions = ['developer']
|
|
||||||
|
|
||||||
for extension in default_extensions:
|
|
||||||
bot.load_extension(f'cogs.{extension}')
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
|
@ -35,16 +31,22 @@ async def load(ctx, extension):
|
||||||
bot.load_extension(f'cogs.{extension}')
|
bot.load_extension(f'cogs.{extension}')
|
||||||
print(f'cogs.{extension} loaded')
|
print(f'cogs.{extension} loaded')
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def unload(ctx, extension):
|
async def unload(ctx, extension):
|
||||||
bot.unload_extension(f'cogs.{extension}')
|
bot.unload_extension(f'cogs.{extension}')
|
||||||
print(f'cogs.{extension} unloaded')
|
print(f'cogs.{extension} unloaded')
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def reload(ctx, extension):
|
async def reload(ctx, extension):
|
||||||
bot.reload_extension(f'cogs.{extension}')
|
bot.reload_extension(f'cogs.{extension}')
|
||||||
print(f'cogs.{extension} reloaded')
|
print(f'cogs.{extension} reloaded')
|
||||||
|
|
||||||
|
|
||||||
|
for extension in ['developer']:
|
||||||
|
bot.load_extension(f'cogs.{extension}')
|
||||||
|
|
||||||
bot.run(TOKEN)
|
bot.run(TOKEN)
|
||||||
|
|
Loading…
Reference in New Issue