def set_channel(self, ctx, on_off: bool, channel: discord.Channel = None):
"""Sets channel logging on or off. Optional channel parameter.
To enable or disable all channels at once, use `logset server`."""
if channel is None:
channel = ctx.message.channel
server = channel.server
if server.id not in self.settings:
self.settings[server.id] = {}
self.settings[server.id][channel.id] = on_off
if on_off:
await self.bot.say('Logging enabled for %s' % channel.mention)
else:
await self.bot.say('Logging disabled for %s' % channel.mention)
self.save_json()
评论列表
文章目录