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)
评论列表
文章目录