api.py 文件源码

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

项目:LunaBot 作者: miraai 项目源码 文件源码
def log(self, ctx, *, user: str):
        """Shows mod log entries for a user.

        Only searches the past 300 cases.
        """

        mod_log = ctx.message.server.get_channel('222010090226581504')
        entries = []
        async for m in self.bot.logs_from(mod_log, limit=300):
            entry = self.pollr.match(m.content)
            if entry is None:
                continue

            if user in entry.group('user'):
                entries.append(m.content)

        fmt = 'Found {} entries:\n{}'
        await self.bot.say(fmt.format(len(entries), '\n\n'.join(entries)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号