Feed.py 文件源码

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

项目:CorpBot.py 作者: corpnewt 项目源码 文件源码
def killrole(self, ctx):
        """Lists the required role to kill/resurrect the bot."""

        # Check if we're suppressing @here and @everyone mentions
        if self.settings.getServerStat(ctx.message.server, "SuppressMentions").lower() == "yes":
            suppress = True
        else:
            suppress = False

        role = self.settings.getServerStat(ctx.message.server, "RequiredKillRole")
        if role == None or role == "":
            msg = '**Only Admins** can kill/ressurect the bot.'.format(ctx)
            await self.bot.say(msg)
        else:
            # Role is set - let's get its name
            found = False
            for arole in ctx.message.server.roles:
                if arole.id == role:
                    found = True
                    msg = 'You need to be a/an **{}** to kill/ressurect the bot.'.format(arole.name)
            if not found:
                msg = 'There is no role that matches id: `{}` - consider updating this setting.'.format(role)
            # Check for suppress
            if suppress:
                msg = Nullify.clean(msg)
            await self.bot.send_message(ctx.message.channel, msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号