lunarflu HF staff commited on
Commit
a208ce7
1 Parent(s): 42715b3

post spam warning in public channels only once in case of mass spammers

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- await channel.send(f"{message.author.mention}, you may be posting too quickly! Please slow down a bit 🤗")
 
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']