arrow_backBack to Features

Anti-Flood Protection

Intelligent spam prevention that detects flooding attacks and auto-mutes repeat offenders with configurable thresholds.

Overview

Anti-flood protection tracks message rates per user within a 60-second sliding window. When a user exceeds the configured message limit, the bot automatically takes action.

All flood messages can be automatically deleted, and the system supports warnings before taking punitive action.

How It Works

  1. 1.Bot tracks message count for each user in a 60-second window
  2. 2.When user exceeds the limit, all their flood messages are logged
  3. 3.If warnings are configured, user receives warnings first
  4. 4.After warnings exhausted, configured action is taken (mute/warn/kick/ban)
  5. 5.If enabled, all flood messages are deleted

Mini App Configuration

Open /app → Settings → Anti-Flood Protection

Enable Anti-Flood

Toggle to enable/disable flood protection.

Message Limit (per minute)

Maximum messages a user can send in 60 seconds before triggering:

ParameterValue
Minimum3 messages
Maximum100 messages
Default10 messages

Action When Flooding

What happens when a user exceeds the limit:

ActionBehavior
muteRestrict user from sending messages temporarily
warnSend warning message to user
kickRemove user from group (can rejoin)
banPermanently ban user from group

Mute Duration

When action is "mute", how long the user is restricted:

1 minute5 minutes10 minutes30 minutes1 hour

Default: 5 minutes (300 seconds)

Delete Flood Messages

When enabled, all messages sent during the flood attack are deleted. The bot tracks message IDs and deletes them in bulk.

Warnings Before Action

Number of warnings before the configured action is taken:

OptionBehavior
0No warnings, immediate action
11 warning, then action
22 warnings, then action
33 warnings, then action

Bot Commands

/antiflood onEnable anti-flood protection
/antiflood offDisable anti-flood protection
/antiflood limit 5Set message limit to 5 per minute
/antiflood statusCheck current settings

Technical Details

  • Window: 60-second sliding window per user per group
  • Tracking: Message IDs are stored for bulk deletion
  • Reset: Counter resets when window expires
  • Database: Uses FloodTracker model with group_id, telegram_id, message_count, window_start
  • Silent mode: Can be configured to suppress notifications (silent_automations)