cmds.py 文件源码

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

项目:Discord-SelfBot 作者: IgneelDxD 项目源码 文件源码
def cmds(self, ctx):
        """Show all custom commands."""
        if ctx.invoked_subcommand is None:
            ttl = None if ctx.message.content.endswith(' stay') else 20
            p = commands.Paginator(prefix='```css')
            cmds = read_json("commands")
            p.add_line('[List of Custom Commands]')
            msg = []
            for cmd in sorted(cmds):
                msg.append(cmd)
                if cmd == list(sorted(cmds))[-1] or len(msg) % 5 == 0 and len(msg) != 0:
                    p.add_line(', '.join(x for x in msg))
                    msg = []
            for page in p.pages:
                await ctx.send(page, delete_after=ttl)
            await ctx.message.delete()

    # List all custom commands with Links
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号