Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ async def on_message(message):
|
|
74 |
user_cooldowns[message.author.id]['count'] += 1
|
75 |
|
76 |
# tldr; if we post 2 messages with less than 1s between them
|
77 |
-
if user_cooldowns[message.author.id]['count'] >
|
78 |
var1 = message.created_at
|
79 |
var2 = user_cooldowns[message.author.id]['timestamp']
|
80 |
print(f"seconds since last message by {message.author}: {(var1 - var2).total_seconds()}")
|
|
|
74 |
user_cooldowns[message.author.id]['count'] += 1
|
75 |
|
76 |
# tldr; if we post 2 messages with less than 1s between them
|
77 |
+
if user_cooldowns[message.author.id]['count'] > 3: # 4 in a row, helps avoid false positives for posting in threads
|
78 |
var1 = message.created_at
|
79 |
var2 = user_cooldowns[message.author.id]['timestamp']
|
80 |
print(f"seconds since last message by {message.author}: {(var1 - var2).total_seconds()}")
|