help.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:kitsuchan-2 作者: n303p4 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号