hide owner cog from slash command list

This commit is contained in:
2021-10-31 11:27:21 +01:00
parent 4a2cc0e62b
commit 2eb3914ede
+12 -6
View File
@@ -28,7 +28,7 @@ class OwnerCog(commands.Cog):
return content.strip("` \n")
# Hidden means it won't show up on the default help.
@commands.command(name="load", hidden=True)
@commands.command(name="load", hidden=True, slash_command=False)
@commands.is_owner()
async def _cog_load(self, ctx: Context, *, cog: str):
"""Command which Loads a Module."""
@@ -40,7 +40,7 @@ class OwnerCog(commands.Cog):
else:
await ctx.send("**`SUCCESS`**")
@commands.command(name="unload", hidden=True)
@commands.command(name="unload", hidden=True, slash_command=False)
@commands.is_owner()
async def _cog_unload(self, ctx, *, cog: str):
"""Command which Unloads a Module."""
@@ -52,7 +52,7 @@ class OwnerCog(commands.Cog):
else:
await ctx.send("**`SUCCESS`**")
@commands.command(name="reload", hidden=True)
@commands.command(name="reload", hidden=True, slash_command=False)
@commands.is_owner()
async def _cog_reload(self, ctx, *, cog: str):
"""Command which Reloads a Module."""
@@ -65,14 +65,20 @@ class OwnerCog(commands.Cog):
else:
await ctx.send("**`SUCCESS`**")
@commands.command(name="shutdown", hidden=True)
@commands.command(name="shutdown", hidden=True, slash_command=False)
@commands.is_owner()
async def shutdown(self, ctx):
"""Command which shutdowns the bot."""
await ctx.bot.logout()
@commands.is_owner()
@commands.command(pass_context=True, hidden=True, name="eval", aliases=["evaluate"])
@commands.command(
pass_context=True,
hidden=True,
name="eval",
aliases=["evaluate"],
slash_command=False,
)
async def _eval(self, ctx, *, body: str):
env = {
"bot": self.bot,
@@ -167,7 +173,7 @@ class OwnerCog(commands.Cog):
await ctx.send(embed=ssfooem)
@commands.is_owner()
@commands.command(hidden=True, aliases=["exec"])
@commands.command(hidden=True, aliases=["exec"], slash_command=False)
async def execute(self, ctx, *, text: str):
"""Do a shell command."""
message = await ctx.send(f"Loading...")