mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
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:
parent
fa223e22ed
commit
f2ebf52f6e
@ -529,6 +529,8 @@ class Core(commands.Cog, CoreLogic):
|
|||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
async def load(self, ctx: commands.Context, *cogs: str):
|
async def load(self, ctx: commands.Context, *cogs: str):
|
||||||
"""Loads packages"""
|
"""Loads packages"""
|
||||||
|
if not cogs:
|
||||||
|
return await ctx.send_help()
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
loaded, failed, not_found, already_loaded, failed_with_reason = await self._load(cogs)
|
loaded, failed, not_found, already_loaded, failed_with_reason = await self._load(cogs)
|
||||||
|
|
||||||
@ -569,6 +571,8 @@ class Core(commands.Cog, CoreLogic):
|
|||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
async def unload(self, ctx: commands.Context, *cogs: str):
|
async def unload(self, ctx: commands.Context, *cogs: str):
|
||||||
"""Unloads packages"""
|
"""Unloads packages"""
|
||||||
|
if not cogs:
|
||||||
|
return await ctx.send_help()
|
||||||
unloaded, failed = await self._unload(cogs)
|
unloaded, failed = await self._unload(cogs)
|
||||||
|
|
||||||
if unloaded:
|
if unloaded:
|
||||||
@ -585,6 +589,8 @@ class Core(commands.Cog, CoreLogic):
|
|||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
async def reload(self, ctx: commands.Context, *cogs: str):
|
async def reload(self, ctx: commands.Context, *cogs: str):
|
||||||
"""Reloads packages"""
|
"""Reloads packages"""
|
||||||
|
if not cogs:
|
||||||
|
return await ctx.send_help()
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
loaded, failed, not_found, already_loaded, failed_with_reason = await self._reload(
|
loaded, failed, not_found, already_loaded, failed_with_reason = await self._reload(
|
||||||
cogs
|
cogs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user