[Mod] Improved filter's help (#2357)

Co-authored-by: Iangit1 <43935737+Iangit1@users.noreply.github.com>
This commit is contained in:
Twentysix 2019-02-06 22:25:59 +01:00 committed by GitHub
parent a42c4fb215
commit 7d4e5fd390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1134,7 +1134,9 @@ class Mod:
Use double quotes to add/remove sentences
Using this command with no subcommands will send
the list of the server's filtered words."""
the list of the server's filtered words.
Bot owners, server owners and mods / admins are immune
to the filter"""
if ctx.invoked_subcommand is None:
await self.bot.send_cmd_help(ctx)
server = ctx.message.server
@ -1161,6 +1163,9 @@ class Mod:
await self.bot.send_cmd_help(ctx)
return
server = ctx.message.server
explanation = ("Please note: the filter will only work in channels "
"where the bot has the `manage_messages` "
"permission.")
added = 0
if server.id not in self.filter.keys():
self.filter[server.id] = []
@ -1170,7 +1175,8 @@ class Mod:
added += 1
if added:
dataIO.save_json("data/mod/filter.json", self.filter)
await self.bot.say("Words added to filter.")
await self.bot.say("Words added to filter.\n" +
explanation)
else:
await self.bot.say("Words already in the filter.")