Spam Filter Bot Admin Guide
This bot quietly removes spam messages based on rules added by group admins.
The bot does not ban, kick, mute, warn, restrict, or punish users. It only deletes messages that match the spam blocklist.
Who Can Use It?
Only Telegram group admins can use the bot commands.
Regular users who try commands are silently ignored.
Main Commands
The bot has three main commands:
1. Add Spam Rules
Use /add to add something to the spam blocklist.
Add a Keyword
Use this for recurring spam words, phrases, links, usernames, services, or calls to action.
Examples:
Keyword rules are flexible. The bot also tries to catch simple obfuscation, such as spaces, dots, dashes, and common symbol swaps.
For example, a rule like:
may also catch:
Add an Exact Rule
Use this when you only want to block a very specific message.
Exact rules are safer than broad keyword rules, but they may miss spam if the spammer changes the wording.
Add a Phrase Rule
Use this for longer spam messages where the spammer may change a few words.
Phrase rules are conservative. They only match when enough distinctive words overlap. They are designed to avoid catching normal users by accident.
Add a Regex Rule
Regex is advanced. Use only when you know exactly what pattern you want.
Regex can be powerful, but it can also create false positives if written too broadly.
2. Quick Add by Replying to Spam
The easiest workflow is:
- Find a spam message.
- Reply to that spam message with:
The bot will add the replied-to message or caption to the spam list.
If configured, the bot will also delete:
- the spam message you replied to
- your
/addcommand message
This keeps the group clean.
Example:
The bot adds that spam message to the blocklist.
Depending on configuration, reply-added messages may be stored as a conservative phrase rule so minor wording changes can still be caught without being overly broad.
3. List Current Rules
Use:
Example output:
Each rule has a number like #1, #2, or #3.
Use that number when removing a rule.
Search the List
Use /list <search> to find matching rules.
Examples:
This helps find rules when the list gets long.
4. Remove Rules
Remove by ID
This is the safest method.
That removes rule #3.
The bot may preserve old rule numbers for audit history, so numbers may not reset back to #1 after removing rules. That is normal.
Remove by Fuzzy Search
If you do not remember the rule number:
The bot will suggest close matches and tell you which ID to remove.
It should not remove fuzzy matches automatically. This prevents deleting the wrong rule by mistake.
Example:
Bot may respond:
Then run:
Recommended Admin Workflow
For Obvious Repeated Keywords
Use:
Examples:
For Full Spam Messages
Reply directly to the spam message with:
This is the quickest and cleanest method.
For Risky or Common Words
Be careful with broad terms.
Avoid adding overly generic single words like:
These may catch real users.
Prefer more specific phrases:
What the Bot Tries to Catch
The bot can catch simple spam obfuscation for normal keyword rules.
Examples:
It does not use AI or semantic guessing. This is intentional to reduce false positives.
Safety Notes
The bot is designed to prefer missing some spam over deleting real users’ messages.
Use broad rules carefully.
Good rules:
Riskier rules:
Those may be valid conversation topics, depending on the group.
When in doubt, use a longer phrase or reply to the spam with /add.
Troubleshooting
I used /add, but nothing happened
Possible causes:
- You are not a Telegram admin in the group.
- The bot is not running.
- The bot is not allowed in this chat.
- The bot is missing permissions.
- The command was typed in the wrong group.
The bot adds rules but does not delete messages
The bot needs admin permission:
It does not need ban, kick, mute, invite, pin, or admin-management permissions.
/list works, but spam is not being deleted
Possible causes:
- The bot is still in dry-run mode.
- The spam message does not match any rule.
- The bot lacks Delete messages permission.
- The rule is too exact and the spammer changed wording.
Rule numbers skip
This is normal.
If rule #1 is removed, the next new rule may be #2, not #1.
Old IDs are preserved for audit history.
Quick Command Cheat Sheet
Add a keyword rule.
Add an exact-message rule.
Add a conservative phrase rule.
Add an advanced regex rule.
Quickly add the replied-to spam message.
Show active rules.
Search active rules.
Remove rule #4.
Find close matching rules before removing.