def recheckroles(self, ctx):
"""Re-iterate through all members and assign the proper roles based on their xp (admin only)."""
author = ctx.message.author
server = ctx.message.server
channel = ctx.message.channel
isAdmin = author.permissions_in(channel).administrator
# Only allow admins to change server stats
if not isAdmin:
await self.bot.send_message(channel, 'You do not have sufficient privileges to access this command.')
return
changeCount = 0
for member in server.members:
# Now we check for promotions
if await CheckRoles.checkroles(member, channel, self.settings, self.bot, True):
changeCount += 1
if changeCount == 1:
await self.bot.send_message(channel, 'Done checking roles.\n\n*1 user* updated.')
else:
await self.bot.send_message(channel, 'Done checking roles.\n\n*{} users* updated.'.format(changeCount))
评论列表
文章目录