Skip to content

Commit

Permalink
For silently filtered words, show a report and don't delete the word
Browse files Browse the repository at this point in the history
  • Loading branch information
SlimShadyIAm committed May 19, 2024
1 parent 2915da1 commit 9fe60ad
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cogs/monitors/mod/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from discord.ext import commands
from utils import cfg, logger, scam_cache
from utils.framework import gatekeeper, find_triggered_filters
from utils.framework.filter import ignorable_words
from utils.mod import mute
from utils.views import manual_report, report

Expand Down Expand Up @@ -120,21 +121,26 @@ async def bad_word_filter(self, message) -> bool:
if not triggered_words:
return

dev_role = message.guild.get_role(cfg.roles.developer)

triggered = False
for word in triggered_words:
if word.piracy:
# ignore if it's a dev saying piracy in #development
if message.channel.id == cfg.roles.developer in message.author.roles:
continue

if word.notify:
if word.silent_filter:
# don't delete the word if it's silently filtered,
# just notify the mods
await report(self.bot, message, word.word)
return
elif word.notify:
await self.delete(message)
await self.ratelimit(message)
await self.do_filter_notify(message, word)

if not word.piracy:
await report(self.bot, message, word.word)

return

triggered = True
Expand Down

0 comments on commit 9fe60ad

Please sign in to comment.