Merge pull request #166 from classabbyamp/5c-extctl-alias

Added aliases for extctl and subcommands
This commit is contained in:
Abigail Gold 2020-01-08 03:55:51 -05:00 committed by GitHub
commit 1a1b4c9329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
main.py
View File

@ -82,7 +82,7 @@ async def _shutdown_bot(ctx: commands.Context):
await bot.logout()
@bot.group(name="extctl", hidden=True)
@bot.group(name="extctl", aliases=["ex"], hidden=True)
@commands.check(cmn.check_if_owner)
async def _extctl(ctx: commands.Context):
"""Extension control commands.
@ -92,7 +92,7 @@ async def _extctl(ctx: commands.Context):
await ctx.invoke(cmd)
@_extctl.command(name="list")
@_extctl.command(name="list", aliases=["ls"])
async def _extctl_list(ctx: commands.Context):
"""Lists Extensions."""
embed = cmn.embed_factory(ctx)
@ -101,7 +101,7 @@ async def _extctl_list(ctx: commands.Context):
await ctx.send(embed=embed)
@_extctl.command(name="load")
@_extctl.command(name="load", aliases=["ld"])
async def _extctl_load(ctx: commands.Context, extension: str):
try:
bot.load_extension(ext_dir + "." + extension)
@ -111,7 +111,7 @@ async def _extctl_load(ctx: commands.Context, extension: str):
await ctx.send(embed=embed)
@_extctl.command(name="reload", aliases=["relaod"])
@_extctl.command(name="reload", aliases=["rl", "r", "relaod"])
async def _extctl_reload(ctx: commands.Context, extension: str):
if ctx.invoked_with == "relaod":
pika = bot.get_emoji(opt.pika)
@ -125,7 +125,7 @@ async def _extctl_reload(ctx: commands.Context, extension: str):
await ctx.send(embed=embed)
@_extctl.command(name="unload")
@_extctl.command(name="unload", aliases=["ul"])
async def _extctl_unload(ctx: commands.Context, extension: str):
try:
bot.unload_extension(ext_dir + "." + extension)