def banmentionspam(self, ctx, max_mentions : int=False):
"""Enables auto ban for messages mentioning X different people
Accepted values: 5 or superior"""
server = ctx.message.server
if max_mentions:
if max_mentions < 5:
max_mentions = 5
self.settings[server.id]["ban_mention_spam"] = max_mentions
await self.bot.say("Autoban for mention spam enabled. "
"Anyone mentioning {} or more different people "
"in a single message will be autobanned."
"".format(max_mentions))
else:
if self.settings[server.id]["ban_mention_spam"] is False:
await send_cmd_help(ctx)
return
self.settings[server.id]["ban_mention_spam"] = False
await self.bot.say("Autoban for mention spam disabled.")
dataIO.save_json("data/mod/settings.json", self.settings)
评论列表
文章目录