Update flood checking

This commit is contained in:
AlberLC
2022-11-03 21:09:49 +01:00
parent a967f7d594
commit 4cc610d579
2 changed files with 3 additions and 3 deletions

View File

@@ -147,7 +147,7 @@ class FlanaBot(MultiBot, ABC):
'date': {'$gte': datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(seconds=7)} 'date': {'$gte': datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(seconds=7)}
}) })
if len(last_2s_messages) >= constants.FLOOD_2s_LIMIT or len(last_7s_messages) >= constants.FLOOD_7s_LIMIT: if len(last_2s_messages) > constants.FLOOD_2s_LIMIT or len(last_7s_messages) > constants.FLOOD_7s_LIMIT:
punishment = Punishment.find_one({ punishment = Punishment.find_one({
'platform': self.platform.value, 'platform': self.platform.value,
'user_id': message.author.id, 'user_id': message.author.id,

View File

@@ -4,8 +4,8 @@ AUDIT_LOG_AGE = datetime.timedelta(hours=1)
AUDIT_LOG_LIMIT = 5 AUDIT_LOG_LIMIT = 5
AUTO_WEATHER_EVERY = datetime.timedelta(hours=6) AUTO_WEATHER_EVERY = datetime.timedelta(hours=6)
CHECK_PUNISHMENTS_EVERY_SECONDS = datetime.timedelta(hours=1).total_seconds() CHECK_PUNISHMENTS_EVERY_SECONDS = datetime.timedelta(hours=1).total_seconds()
FLOOD_2s_LIMIT = 4 FLOOD_2s_LIMIT = 2
FLOOD_7s_LIMIT = 7 FLOOD_7s_LIMIT = 4
HEAT_PERIOD_SECONDS = datetime.timedelta(minutes=15).total_seconds() HEAT_PERIOD_SECONDS = datetime.timedelta(minutes=15).total_seconds()
INSULT_PROBABILITY = 0.00166666667 INSULT_PROBABILITY = 0.00166666667
MAX_PLACE_QUERY_LENGTH = 50 MAX_PLACE_QUERY_LENGTH = 50