formatter.py 文件源码

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

项目:Chiaki-Nanami 作者: Ikusaba-san 项目源码 文件源码
def subcommands(self):
        if self._on_subcommand_page:
            return None

        ctx, command = self.context, self.command

        assert isinstance(command, commands.GroupMixin), "command has no subcommands"
        self._on_subcommand_page = True
        subs = sorted(map(str, set(command.walk_commands())))

        note = (
            f'Type `{ctx.clean_prefix}{ctx.invoked_with} {command} subcommand`'
            f' for more info on a subcommand.\n'
            f'(e.g. type `{ctx.clean_prefix}{ctx.invoked_with} {random.choice(subs)}`)'
        )

        return (discord.Embed(colour=self.colour, description='\n'.join(map('`{}`'.format, subs)))
                .set_author(name=f'Child Commands for {command}')
                .add_field(name='\u200b', value=note, inline=False)
                )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号