mod.py 文件源码

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

项目:LunaBot 作者: miraai 项目源码 文件源码
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.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号