def setrules(self, ctx, *, rules : str = None):
"""Set the server's rules (admin only)."""
isAdmin = ctx.message.author.permissions_in(ctx.message.channel).administrator
# Only allow admins to change server stats
if not isAdmin:
await self.bot.send_message(ctx.message.channel, 'You do not have sufficient privileges to access this command.')
return
if rules == None:
rules = ""
self.settings.setServerStat(ctx.message.server, "Rules", rules)
msg = 'Rules now set to:\n{}'.format(rules)
await self.bot.send_message(ctx.message.channel, msg)
评论列表
文章目录