privatemsg.py 文件源码

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

项目:ICO-Moderator 作者: Plenglin 项目源码 文件源码
def on_private_message(self, msg: discord.Message):
        categories = {}
        for c in self.registry.commands:
            print(c)
            help = c.get_help(msg)
            if help is not None:
                cat = help.category
                if cat not in categories:
                    categories[cat] = []
                categories[cat].append(help)

        output = '__**Available commands:**__\n\n'
        for cat, helps in sorted(categories.items()):
            output += '**{}**\n'.format(cat)
            for h in helps:
                output += '`{title}` {desc}\n'.format(title=h.title, desc=h.desc)
                output += '\n'
        await self.client.send_message(msg.channel, output)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号