def unignore(self, ctx, *channels: discord.Channel):
"""Unignores channels from being processed.
If no channels are specified, it unignores the current channel.
To use this command you must have the Manage Channels permission or have the
Bot Admin role.
"""
if len(channels) == 0:
channels = (ctx.message.channel,)
# a set is the proper data type for the ignore list
# however, JSON only supports arrays and objects not sets.
ignored = self.config.get('ignored', [])
for channel in channels:
try:
ignored.remove(channel.id)
except ValueError:
pass
await self.config.put('ignored', ignored)
await self.bot.say('**Done!** The channels are unignored.')
评论列表
文章目录