Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update forbidden strings
#9
by
christopher
- opened
app.py
CHANGED
@@ -68,8 +68,10 @@ async def on_message(message):
|
|
68 |
"""Antispam"""
|
69 |
#Detecting certain unwanted strings
|
70 |
try:
|
71 |
-
|
72 |
-
|
|
|
|
|
73 |
ignored_role_ids = [897381378172264449, 897376942817419265] #admins, huggingfolks
|
74 |
if any(role.id in ignored_role_ids for role in message.author.roles):
|
75 |
if message.author != lunarflu:
|
|
|
68 |
"""Antispam"""
|
69 |
#Detecting certain unwanted strings
|
70 |
try:
|
71 |
+
forbidden_patterns = [r"@everyone",
|
72 |
+
r"@here",
|
73 |
+
r"(https?:\/\/|http?:\/\/)?(www.)?(discord.(gg|io|me|li)|discordapp.com\/invite|discord.com\/invite)\/[^\s\/]+?(?=\b)"]
|
74 |
+
if any(re.search(pattern, message.content, re.IGNORECASE) for pattern in forbidden_patterns):
|
75 |
ignored_role_ids = [897381378172264449, 897376942817419265] #admins, huggingfolks
|
76 |
if any(role.id in ignored_role_ids for role in message.author.roles):
|
77 |
if message.author != lunarflu:
|