Link filter

Link rule modes and assignment behavior.

Link rules delete messages containing links according to the selected mode.

Where to Configure

Dashboard path:

/link_rules

Visible navigation label: Links.

A link rule can block all links, block specific domains, or allow only approved domains.

Link rules are checked after blocked users and stop words, and before required words and rate limits.

Each group can have one active link rule.

Fields

A link rule has:

  • Name, max 100 characters.
  • Mode.
  • Domain list, depending on mode.
  • Assigned groups.
  • Active flag.
  • Delete Telegram invite links flag.
  • Delete Telegram public links flag.

Modes

Internal value: block_all.

Any detected link is blocked.

Domain lists are not used in this mode.

Use this for groups where users should not post links at all.

Block Listed Domains

Internal value: block_listed.

Only domains in the blocked domain list are blocked.

You must add at least one blocked domain.

Example blocked domains:

spam.example
phishing.example
bad-domain.net

Allow Only Approved Domains

Internal value: allow_approved.

Only domains in the allowed domain list are allowed. Any other detected domain is blocked.

You must add at least one allowed domain.

Example allowed domains:

example.com
docs.example.com
github.com

Domain Normalization

Domains are normalized before storage.

The normalizer:

  • Trims whitespace.
  • Lowercases the domain.
  • Removes http:// or https://.
  • Removes a leading www..
  • Removes path, query, fragment, port, and trailing punctuation.
  • Requires a valid domain shape.

Examples:

https://www.Example.com/path?q=1
example.com

Both become:

example.com

The runtime checks links from message text and normalized link source content. It detects generic domains and Telegram links.

Email-like domains are ignored when the match is immediately preceded by @.

The link rule has two Telegram-specific checkboxes.

Blocks Telegram invite links such as:

https://t.me/+abcdef
https://t.me/joinchat/abcdef

The event reason is forbidden_invite_link.

Blocks Telegram public links and bot links such as:

https://t.me/examplechannel
https://t.me/examplebot

The event reason is forbidden_telegram_link.

Telegram-specific flags are checked before the generic mode logic.

Assignment Behavior

Assignments can be managed on the link rule form or on the Groups page.

One group can have one active link rule. Assigning a group to another link rule creates a conflict or replaces the per-group assignment depending on the workflow used.

Examples

Mode:

Block all links

Useful for announcement comments or high-spam groups.

Block Known Bad Domains

Mode:

Block listed domains

Blocked domains:

scam.example
fake-airdrop.example

Allow Official Domains Only

Mode:

Allow only approved domains

Allowed domains:

company.com
docs.company.com
support.company.com

Limitations

Current link filter does not support:

  • Regex domain rules.
  • Wildcard syntax such as *.example.com.
  • Per-domain actions other than delete.
  • User allowlists.