Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
antispam alerts update (longer cooldown, catches staggered spam)
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ async def on_message(message):
|
|
| 46 |
|
| 47 |
|
| 48 |
### antispam experiment
|
| 49 |
-
cooldown_duration =
|
| 50 |
if message.author.id not in user_cooldowns:
|
| 51 |
user_cooldowns[message.author.id] = {'count': 1, 'timestamp': message.created_at}
|
| 52 |
else:
|
|
@@ -75,7 +75,7 @@ async def on_message(message):
|
|
| 75 |
alert = "<@&1108342563628404747>" # normal @alerts role
|
| 76 |
|
| 77 |
await bot.log_channel.send(
|
| 78 |
-
f"[EXPERIMENTAL ALERT] {message.author
|
| 79 |
f"Spam count: {user_cooldowns[message.author.id]['count']}\n"
|
| 80 |
f"Message content: {message.content}\n"
|
| 81 |
f"[Jump to message!](https://discord.com/channels/{message.guild.id}/{message.channel.id}/{message.id})\n"
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
### antispam experiment
|
| 49 |
+
cooldown_duration = 3 # messages per n seconds, was 1, now 3, could try 5
|
| 50 |
if message.author.id not in user_cooldowns:
|
| 51 |
user_cooldowns[message.author.id] = {'count': 1, 'timestamp': message.created_at}
|
| 52 |
else:
|
|
|
|
| 75 |
alert = "<@&1108342563628404747>" # normal @alerts role
|
| 76 |
|
| 77 |
await bot.log_channel.send(
|
| 78 |
+
f"[EXPERIMENTAL ALERT] {message.author} may be posting too quickly! \n"
|
| 79 |
f"Spam count: {user_cooldowns[message.author.id]['count']}\n"
|
| 80 |
f"Message content: {message.content}\n"
|
| 81 |
f"[Jump to message!](https://discord.com/channels/{message.guild.id}/{message.channel.id}/{message.id})\n"
|