owner.py 文件源码

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

项目:kitsuchan-2 作者: n303p4 项目源码 文件源码
def censor(self, ctx, times: int=1):
        """Delete the bot's previous message(s). Bot owner only.

        * times - Number of message to delete. Defaults to 1.
        """
        if times < 1:
            return commands.UserInputError("Can't delete less than 1 message.")
        times_executed = 0
        async for message in ctx.channel.history():
            if times_executed == times:
                break
            if message.author.id == ctx.bot.user.id:
                await message.delete()
                times_executed += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号