def setsstat(self, ctx, stat : str = None, value : str = None):
"""Sets a server stat (admin only)."""
author = ctx.message.author
server = ctx.message.server
channel = ctx.message.channel
isAdmin = author.permissions_in(ctx.message.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
if stat == None or value == None:
msg = 'Usage: `{}setsstat Stat Value`'.format(ctx.prefix)
await self.bot.send_message(channel, msg)
return
self.setServerStat(server, stat, value)
msg = '**{}** set to *{}!*'.format(stat, value)
await self.bot.send_message(channel, msg)
评论列表
文章目录