Documentation menu
Getting started
New in v2.0
Feature deep dives
Reference
Filters & Access Control
Whitelist, Blacklist & Media Filters
Deterministic forwarding filters: keyword matching with Unicode folding, media-type blocking, link detection and ReDoS-safe regex evaluation.
Verified against the checkout built for v2.2.4 · updated 20 Oct 2026
Overview
The FilterEngine in AutoTelegramForward executes deterministic, multi-stage inspection on incoming Telegram messages before any forwarding or copying occurs. If a message violates filtering criteria, it is dropped early with full diagnostic logging (e.g. [PIPELINE:FILTER_DROP]), saving network bandwidth and rate-limit quotas.
Supported Filter Capabilities
✅ Whitelist (Allow-Only Filter)
Required MatchWhen whitelist keywords or regex patterns are defined, a message must match at least one whitelist pattern to proceed. If none match, the message is quietly dropped.
⛔ Blacklist (Block Filter)
Immediate RejectionIf an incoming message matches any blacklisted word, phrase, or regular expression, forwarding is immediately aborted.
🔗 Link Detection Filter
filter_type: "link"Specifically rejects any incoming message containing web URLs, IP addresses, or Telegram deep links, preventing external channel promotion.
🎬 Media Type Filter
Granular TogglesFilter out specific categories of Telegram media while allowing others:
Filter Evaluation Pipeline Order
To prevent race conditions, the FilterEngine evaluates rules in strict order:
- Media Type Check: If the message media matches any active
block_*rule, drop immediately. - Link Check: If
filter_type == "link"and any link is detected, drop immediately. - Whitelist Check: If a whitelist exists and no match is found, drop.
- Blacklist Check: If any blacklist keyword or pattern matches, drop.
- Pass: Proceed to the Cleaner and Transformation stages.
ReDoS Prevention & Safe Regular Expressions
All regex patterns submitted via the Telegram Bot or Web API undergo strict compilation checks. Unbounded nested quantifiers (e.g. (a+)+$) that cause catastrophic backtracking are rejected with descriptive error messages. Furthermore, regex evaluations are executed with timeout bounds to protect worker threads.
Configuring Filters via Telegram Bot
- Send
/settingsand select your rule. - Click 🔍 فیلترها (Filters).
- Click ⛔ بلکلیست (Blacklist) or ✅ وایتلیست (Whitelist) to enter keywords (one per line or comma-separated).
- Click 🎬 فیلتر رسانه to toggle blocking of Videos, Voice notes, Stickers, or Audio.