aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar vivekashok1221 <[email protected]>2024-03-28 03:28:06 +0400
committerGravatar vivekashok1221 <[email protected]>2024-03-28 03:28:06 +0400
commitea10480b770d40ea153b3fec88d22d66e5ed7206 (patch)
treea5cd62a233c14ad594cecd04f9a4dbe7339459dc
parentUpdate regex to discard trailing ')' and lowercase triggered URL before set d... (diff)
Skip adding phishing button if user already banned
-rw-r--r--bot/exts/filtering/_ui/ui.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/exts/filtering/_ui/ui.py b/bot/exts/filtering/_ui/ui.py
index 252efadeb..49f4614c7 100644
--- a/bot/exts/filtering/_ui/ui.py
+++ b/bot/exts/filtering/_ui/ui.py
@@ -617,6 +617,9 @@ class AlertView(discord.ui.View):
def __init__(self, ctx: FilterContext, triggered_filters: dict[FilterList, list[str]] | None = None):
super().__init__(timeout=ALERT_VIEW_TIMEOUT)
self.ctx = ctx
+ if "banned" in self.ctx.action_descriptions:
+ # If the user has already been banned, do not attempt to add phishing button
+ return
phishing_content, target_filter_list = self._extract_potential_phish(triggered_filters)
if phishing_content:
self.add_item(PhishHandlingButton(ctx.author, phishing_content, target_filter_list))