lunarflu HF staff commited on
Commit
4796db1
1 Parent(s): ecceb72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- member = message.author
136
- await member.send("You have been temporarily timed out (7 Days) for spamming. If this was an error, message <@811235357663297546> or an `@admin`")
137
- await member.timeout(datetime.timedelta(hours=timeout_duration), reason="Spamming")
 
 
 
 
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")