Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
post spam warning in public channels only once in case of mass spammers
Browse files
app.py
CHANGED
@@ -103,7 +103,8 @@ async def on_message(message):
|
|
103 |
if spam_count >= false_positive_threshold: # n in a row, helps avoid false positives for posting in threads
|
104 |
# warning for 5+
|
105 |
channel = message.channel
|
106 |
-
|
|
|
107 |
|
108 |
var1 = message.created_at
|
109 |
var2 = user_cooldowns[message.author.id]['timestamp']
|
|
|
103 |
if spam_count >= false_positive_threshold: # n in a row, helps avoid false positives for posting in threads
|
104 |
# warning for 5+
|
105 |
channel = message.channel
|
106 |
+
if spam_count == false_positive_threshold:
|
107 |
+
await channel.send(f"{message.author.mention}, you may be posting too quickly! Please slow down a bit 🤗")
|
108 |
|
109 |
var1 = message.created_at
|
110 |
var2 = user_cooldowns[message.author.id]['timestamp']
|