Send help on empty [p]load/unload/reload (#2410)

Rather than attempting to load / reload / unload nothing, send command help on bare `[p]load`, etc. commands.
This commit is contained in:
zephyrkul
2019-02-03 23:39:03 -07:00
committed by Toby Harradine
parent f61e8e0907
commit 3b38a5f9b9

View File

@@ -518,6 +518,8 @@ class Core(commands.Cog, CoreLogic):
@checks.is_owner()
async def load(self, ctx: commands.Context, *cogs: str):
"""Loads packages"""
if not cogs:
return await ctx.send_help()
async with ctx.typing():
loaded, failed, not_found, already_loaded = await self._load(cogs)
@@ -548,6 +550,8 @@ class Core(commands.Cog, CoreLogic):
@checks.is_owner()
async def unload(self, ctx: commands.Context, *cogs: str):
"""Unloads packages"""
if not cogs:
return await ctx.send_help()
unloaded, failed = await self._unload(cogs)
if unloaded:
@@ -564,6 +568,8 @@ class Core(commands.Cog, CoreLogic):
@checks.is_owner()
async def reload(self, ctx: commands.Context, *cogs: str):
"""Reloads packages"""
if not cogs:
return await ctx.send_help()
async with ctx.typing():
loaded, failed, not_found, already_loaded = await self._reload(cogs)