Link Filter
The link filter allows you to control which links can be posted in your chat. This feature helps protect members from spam, phishing attacks, and unwanted content.
Operating Modes
The link filtering system supports three modes:
Disabled
Link filtering is not active. All links are allowed in the chat.
Whitelist
Only links from the list are allowed. All other links will be blocked.
Example Usage: You only want to allow links to your website and official social media pages.
Blacklist
Only links from the list are blocked. All other links are allowed.
Example Usage: You want to block specific competitor websites or known spam sources.
Restriction Types
When a prohibited link is detected, the bot can apply one of the following actions:
- Delete message - the message with the link will be deleted.
- Warning - the user will receive a warning, and the message will be deleted.
- Mute - the user will be temporarily prevented from sending messages.
- Ban - the user will be removed from the chat for a specified period.
Restriction Duration
For Mute and Ban modes, you can specify the duration of the restriction. If the duration is not specified, the restriction will be indefinite.
Time format:
30m- 30 minutes2h- 2 hours1d- 1 day1w- 1 week1M- 1 month1y- 1 year
You can combine periods: 1d12h = 1 day 12 hours
Managing the Link List
Adding a Link
- Click the Add or + button.
- Enter the link in the format:
https://example.com - Confirm the addition.
Important: You can add multiple links at once by sending them as a list separated by spaces or on new lines.
Deleting a Link
Click the 🗑️ button next to the link you want to delete and confirm the action.
Link Formats
The system supports various link formats with flexible matching:
Simple Domain
example.com
https://example.com
Blocks all links to the specified domain.
Subdomains with wildcard
*.example.com
Blocks all subdomains (e.g., sub.example.com, another.example.com), but not the main domain example.com.
Specific Path
https://example.com/spam
Blocks only links starting with the specified path:
- ✅
https://example.com/spam - ✅
https://example.com/spam/page - ❌
https://example.com/other
URL Parameters
https://example.com/?ref=spam
Blocks links with specific parameters:
- ✅
https://example.com/?ref=spam - ✅
https://example.com/?ref=spam&other=value - ❌
https://example.com/?ref=other
Wildcard for parameters:
https://example.com/?ref=*
Blocks links with any value for the ref parameter.
Link Checking Algorithm
When a message is posted, the bot checks:
- Text links in the message text or media caption.
- Hidden links (text_link entities) - links hidden within text.
The system compares the detected links with the list according to the following criteria:
- Domain - must match completely (with wildcard).
- Path - the path in the message must start with the path in the list.
- Parameters - all parameters in the list must be present in the link (with wildcard).
Whitelist Mode: If the link does not match any entry in the list, it is blocked.
Blacklist Mode: If the link matches at least one entry in the list, it is blocked.
Configuration Examples
Example 1: Allow only your resources
Mode: Whitelist List of links:
mysite.com
t.me/mychannel
youtube.com/c/mychannel
Users will only be able to post links to the specified resources.
Example 2: Block spam sites
Mode: Blacklist List of links:
spam-site.com
*.spam-network.com
example.com/ads
Links to these resources will be blocked.
Example 3: Protect against referral links
Mode: Blacklist List of links:
shop.com/?ref=*
marketplace.com/?affiliate=*
Links with referral parameters will be blocked.
Configuration via Telegram Bot
- Open the bot's settings in your chat.
- Go to the Automod → Link Filter section.
- Select the operating mode.
- Configure the restriction type and duration (if necessary).
- Add links to the list.
- Done! The filter is activated.
Configuration via Web Application
- Open the bot's web interface.
- Select your chat.
- Go to the Settings → Automod → Link Filter section.
- Configure the operating mode, restrictions, and link list using the interactive elements.
- Changes are saved automatically.
Recommendations
- Regularly update the lists - add new spam sites to the blacklist.
- Be careful with the whitelist - users will not be able to share any other links.
- Use wildcards carefully -
*.comwill block too many legitimate websites. - Test the settings - check the filter with test links before activation.
- Combine with other features - use it along with anti-spam filters for maximum protection.
Frequently Asked Questions
Q: Can I block all links?
A: Yes, create a whitelist and leave it empty - all links will be blocked.
Q: Does the filter work for administrators?
A: No, chat administrators are exempt from the link filter.
Q: Can I block short links (bit.ly, tinyurl)?
A: Yes, add their domains to the blacklist: bit.ly, tinyurl.com, etc.
Q: Are regular expressions supported?
A: No, but you can use the wildcard * for domains and parameters.
Q: What happens if a user edits a message and adds a prohibited link?
A: The filter only checks new messages when they are sent; edits are not checked.