def help(self, ctx, *cmds: str):
"""Help command.
* command_or_cog - The name of a command or cog.
"""
if not cmds:
commands_list = []
for command in ctx.bot.commands:
if command.hidden:
continue
try:
can_run = await command.can_run(ctx)
except Exception:
continue
if can_run:
commands_list.append(command.name)
commands_list.sort()
help_text = f'```{", ".join(commands_list)}```'
help_text += f"\nRun **help command** for more details on a command."
help_text = "**List of commands:**\n" + help_text
await ctx.send(help_text)
else:
# This is awful, haha
await ctx.bot.all_commands["old_help"].callback(ctx, *cmds)
评论列表
文章目录