mod.py 文件源码

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

项目:KeekoBot 作者: DavidNeon 项目源码 文件源码
def _filter(self, ctx):
        """Adds/removes words from filter

        Use double quotes to add/remove sentences
        Using this command with no subcommands will send
        the list of the server's filtered words."""
        if ctx.invoked_subcommand is None:
            await send_cmd_help(ctx)
            server = ctx.message.server
            author = ctx.message.author
            if server.id in self.filter:
                if self.filter[server.id]:
                    words = ", ".join(self.filter[server.id])
                    words = "Filtered in this server:\n\n" + words
                    try:
                        for page in pagify(words, delims=[" ", "\n"], shorten_by=8):
                            await self.bot.send_message(author, page)
                    except discord.Forbidden:
                        await self.bot.say("I can't send direct messages to you.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号