mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Mod] Improved filter's help (#2357)
Co-authored-by: Iangit1 <43935737+Iangit1@users.noreply.github.com>
This commit is contained in:
parent
a42c4fb215
commit
7d4e5fd390
14
cogs/mod.py
14
cogs/mod.py
@ -1134,7 +1134,9 @@ class Mod:
|
|||||||
|
|
||||||
Use double quotes to add/remove sentences
|
Use double quotes to add/remove sentences
|
||||||
Using this command with no subcommands will send
|
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:
|
if ctx.invoked_subcommand is None:
|
||||||
await self.bot.send_cmd_help(ctx)
|
await self.bot.send_cmd_help(ctx)
|
||||||
server = ctx.message.server
|
server = ctx.message.server
|
||||||
@ -1161,6 +1163,9 @@ class Mod:
|
|||||||
await self.bot.send_cmd_help(ctx)
|
await self.bot.send_cmd_help(ctx)
|
||||||
return
|
return
|
||||||
server = ctx.message.server
|
server = ctx.message.server
|
||||||
|
explanation = ("Please note: the filter will only work in channels "
|
||||||
|
"where the bot has the `manage_messages` "
|
||||||
|
"permission.")
|
||||||
added = 0
|
added = 0
|
||||||
if server.id not in self.filter.keys():
|
if server.id not in self.filter.keys():
|
||||||
self.filter[server.id] = []
|
self.filter[server.id] = []
|
||||||
@ -1170,7 +1175,8 @@ class Mod:
|
|||||||
added += 1
|
added += 1
|
||||||
if added:
|
if added:
|
||||||
dataIO.save_json("data/mod/filter.json", self.filter)
|
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:
|
else:
|
||||||
await self.bot.say("Words already in the filter.")
|
await self.bot.say("Words already in the filter.")
|
||||||
|
|
||||||
@ -1357,7 +1363,7 @@ class Mod:
|
|||||||
|
|
||||||
async def new_case(self, server, *, action, mod=None, user, reason=None, until=None, channel=None, force_create=False):
|
async def new_case(self, server, *, action, mod=None, user, reason=None, until=None, channel=None, force_create=False):
|
||||||
action_type = action.lower() + "_cases"
|
action_type = action.lower() + "_cases"
|
||||||
|
|
||||||
enabled_case = self.settings.get(server.id, {}).get(action_type, default_settings.get(action_type))
|
enabled_case = self.settings.get(server.id, {}).get(action_type, default_settings.get(action_type))
|
||||||
if not force_create and not enabled_case:
|
if not force_create and not enabled_case:
|
||||||
return False
|
return False
|
||||||
@ -1468,7 +1474,7 @@ class Mod:
|
|||||||
"discordapp.com/" in tmp["user"].lower()))
|
"discordapp.com/" in tmp["user"].lower()))
|
||||||
if contains_invite:
|
if contains_invite:
|
||||||
tmp["user"] = tmp["user"].replace(".", "\u200b.")
|
tmp["user"] = tmp["user"].replace(".", "\u200b.")
|
||||||
|
|
||||||
case_msg = (
|
case_msg = (
|
||||||
"**Case #{case}** | {action}\n"
|
"**Case #{case}** | {action}\n"
|
||||||
"**User:** {user} ({user_id})\n"
|
"**User:** {user} ({user_id})\n"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user