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.")
评论列表
文章目录