arrow_backBack 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:

FieldDescription
nameRule name/identifier
triggerWhen to check (e.g., message_group)
match_typecontains | regex
patternText pattern to match
action_typewarn | mute | delete | reply | log | kick | ban
warn_thresholdWarnings before escalation (default: 3)
warn_escalation_actionAction after threshold (kick | ban)
priorityRule priority (lower = higher priority)
stop_processingStop checking other rules after match

Warning System

  1. 1.User triggers a rule with action_type "warn"
  2. 2.Warning is recorded in database (per user, per rule)
  3. 3.User receives warning message with count (e.g., "Warning 2/3")
  4. 4.When count exceeds threshold, escalation action is triggered
  5. 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 user

Technical 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