errorlogs.py 文件源码

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

项目:Tobo-Cogs 作者: Tobotimus 项目源码 文件源码
def logerrors(self, ctx: commands.Context):
        """Toggle error logging in this channel."""
        channel = ctx.message.channel
        task = ENABLE
        if channel.id in self.log_channels:
            task = DISABLE
        await self.bot.say("This will {} error logging in this channel. Are you sure about this? Type `yes` to agree".format(task))
        message = await self.bot.wait_for_message(author=ctx.message.author)
        if message is not None and message.content == 'yes':
            if task == ENABLE:
                self.log_channels.append(channel.id)
            elif task == DISABLE:
                self.log_channels.remove(channel.id)
            dataIO.save_json(SETTINGS_PATH, self.log_channels)
            await self.bot.say("Error logging {}d.".format(task))
        else:
            await self.bot.say("The operation was cancelled.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号