Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -132,9 +132,13 @@ async def on_message(message):
|
|
132 |
|
133 |
# timeout for a week
|
134 |
if spam_count >= timeout_threshold:
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
138 |
# reset spam count and timestamp
|
139 |
user_cooldowns[message.author.id] = {'count': 0, 'timestamp': message.created_at}
|
140 |
print(f"{bot.user} timed out {message.author} for {timeout_duration} for Spam")
|
|
|
132 |
|
133 |
# timeout for a week
|
134 |
if spam_count >= timeout_threshold:
|
135 |
+
try:
|
136 |
+
member = message.author
|
137 |
+
#await member.send("You have been temporarily timed out (7 Days) for spamming. If this was an error, message <@811235357663297546> or an `@admin`")
|
138 |
+
await member.timeout(datetime.timedelta(hours=timeout_duration), reason="Spamming")
|
139 |
+
except Exception as e:
|
140 |
+
print(f"Error: {e}")
|
141 |
+
|
142 |
# reset spam count and timestamp
|
143 |
user_cooldowns[message.author.id] = {'count': 0, 'timestamp': message.created_at}
|
144 |
print(f"{bot.user} timed out {message.author} for {timeout_duration} for Spam")
|