fix can_run logic, re-hide xd, remove unnecessary checks

This commit is contained in:
Abigail 2020-01-28 22:45:10 -05:00
parent c1d3c63503
commit 6c32dcbead
3 changed files with 7 additions and 9 deletions

View File

@ -76,9 +76,12 @@ class QrmHelpCommand(commands.HelpCommand):
await self.context.send(embed=embed)
async def send_command_help(self, command):
if self.verify_checks and not await command.can_run(self.context):
raise commands.CheckFailure
return
if self.verify_checks:
if not await command.can_run(self.context):
raise commands.CheckFailure
for p in command.parents:
if not await p.can_run(self.context):
raise commands.CheckFailure
embed = cmn.embed_factory(self.context)
embed.title = await self.get_command_signature(command)
embed.description = command.help
@ -87,7 +90,6 @@ class QrmHelpCommand(commands.HelpCommand):
async def send_group_help(self, group):
if self.verify_checks and not await group.can_run(self.context):
raise commands.CheckFailure
return
embed = cmn.embed_factory(self.context)
embed.title = await self.get_command_signature(group)
embed.description = group.help

View File

@ -30,7 +30,7 @@ class FunCog(commands.Cog):
'''Returns an xkcd about tar.'''
await ctx.send('http://xkcd.com/1168')
@commands.command(name="xd", category=cmn.cat.fun)
@commands.command(name="xd", hidden=True, category=cmn.cat.fun)
async def _xd(self, ctx: commands.Context):
'''ecks dee'''
await ctx.send('ECKS DEE :smirk:')

View File

@ -93,7 +93,6 @@ async def _extctl(ctx: commands.Context):
@_extctl.command(name="list", aliases=["ls"])
@commands.check(cmn.check_if_owner)
async def _extctl_list(ctx: commands.Context):
"""Lists Extensions."""
embed = cmn.embed_factory(ctx)
@ -103,7 +102,6 @@ async def _extctl_list(ctx: commands.Context):
@_extctl.command(name="load", aliases=["ld"])
@commands.check(cmn.check_if_owner)
async def _extctl_load(ctx: commands.Context, extension: str):
try:
bot.load_extension(ext_dir + "." + extension)
@ -114,7 +112,6 @@ async def _extctl_load(ctx: commands.Context, extension: str):
@_extctl.command(name="reload", aliases=["rl", "r", "relaod"])
@commands.check(cmn.check_if_owner)
async def _extctl_reload(ctx: commands.Context, extension: str):
if ctx.invoked_with == "relaod":
pika = bot.get_emoji(opt.pika)
@ -129,7 +126,6 @@ async def _extctl_reload(ctx: commands.Context, extension: str):
@_extctl.command(name="unload", aliases=["ul"])
@commands.check(cmn.check_if_owner)
async def _extctl_unload(ctx: commands.Context, extension: str):
try:
bot.unload_extension(ext_dir + "." + extension)