Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
if user_cooldowns[message.author.id]['count'] > 2: >> 3
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ async def on_message(message):
|
|
61 |
user_cooldowns[message.author.id]['count'] += 1
|
62 |
|
63 |
# tldr; if we post 2 messages with less than 1s between them
|
64 |
-
if user_cooldowns[message.author.id]['count'] >
|
65 |
var1 = message.created_at
|
66 |
var2 = user_cooldowns[message.author.id]['timestamp']
|
67 |
print(f"seconds since last message by {message.author}: {(var1 - var2).total_seconds()}")
|
|
|
61 |
user_cooldowns[message.author.id]['count'] += 1
|
62 |
|
63 |
# tldr; if we post 2 messages with less than 1s between them
|
64 |
+
if user_cooldowns[message.author.id]['count'] > 2: # 3 in a row
|
65 |
var1 = message.created_at
|
66 |
var2 = user_cooldowns[message.author.id]['timestamp']
|
67 |
print(f"seconds since last message by {message.author}: {(var1 - var2).total_seconds()}")
|