Back to Features
Auto-Ban System
Automatically ban users who violate rules repeatedly. Configure warning thresholds and escalation actions with the Rules Engine.
Overview
The auto-ban system is powered by the Rules Engine. Each rule can be configured with a warning threshold and an escalation action. When users hit the threshold, they are automatically kicked or banned.
Rules support pattern matching (contains or regex) and multiple action types including warn, mute, reply, delete, log, and more.
Rules Engine
Each rule has the following structure:
| Field | Description |
|---|---|
| name | Rule name/identifier |
| trigger | When to check (e.g., message_group) |
| match_type | contains | regex |
| pattern | Text pattern to match |
| action_type | warn | mute | delete | reply | log | kick | ban |
| warn_threshold | Warnings before escalation (default: 3) |
| warn_escalation_action | Action after threshold (kick | ban) |
| priority | Rule priority (lower = higher priority) |
| stop_processing | Stop checking other rules after match |
Warning System
- 1.User triggers a rule with action_type "warn"
- 2.Warning is recorded in database (per user, per rule)
- 3.User receives warning message with count (e.g., "Warning 2/3")
- 4.When count exceeds threshold, escalation action is triggered
- 5.Warnings are cleared after escalation
Mini App Configuration
Open /app → Rules
Create Rule
Add new rules with pattern matching and configurable actions.
Edit Rule
Modify pattern, action, threshold, and escalation settings.
Enable/Disable
Toggle rules on/off without deleting them.
Test Console
Dry-run text against your rules to see which would match.
Bot Commands
/autoban onEnable auto-ban system/autoban offDisable auto-ban system/autoban strikes 3Set default strike limit/warn @user [reason]Manually warn a user/unban @userUnban a userTechnical Details
- • Regex safety: Patterns are validated for ReDoS vulnerabilities
- • Timeout: Regex execution times out after 0.1s
- • Case sensitivity: Configurable per rule
- • Actions: reply, delete, warn, mute, kick, ban, log, start_sequence, create_ticket
- • Priority ordering: Lower priority number = evaluated first