botadmin.py 文件源码

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

项目:discordbot.py 作者: rauenzi 项目源码 文件源码
def channel_cmd(self, ctx, *, channel : discord.Channel = None):
        """Ignores a specific channel from being processed.

        If no channel is specified, the current channel is ignored.
        If a channel is ignored then the bot does not process commands in that
        channel until it is unignored.
        """

        if channel is None:
            channel = ctx.message.channel

        ignored = self.config.get('ignored', [])
        if channel.id in ignored:
            await self.bot.responses.failure(message='That channel is already ignored.')
            return

        ignored.append(channel.id)
        await self.config.put('ignored', ignored)
        await self.bot.responses.success(message='Channel <#{}> will be ignored.'.format(channel.id))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号