How to configure GramGroupsBot rules
This page explains how to configure rules after connecting a Telegram group. Start with one group: add one simple rule, test it on a real message, and only then apply the same setup to other groups in your network.
This guide assumes your first group is already connected. If you have not connected a group yet, start with the setup guide.
GramGroupsBot works as one control panel for multiple groups. You create a rule once, choose the groups where it should run, and then verify the result in Telegram.
1. General logic
A rule starts working only after you assign it to a group. If you create a stop-word list but do not assign any groups, Telegram messages will not change.
Best setup order:
- Connect one test group.
- Check that the bot is an administrator.
- Create one simple rule.
- Assign it to that group.
- Send a test message in Telegram.
- Verify the bot did the expected action.
- After verification, apply the rule to other groups.
Example: you run 10 Telegram groups and want to ban the word “scam”. You do not need to add it manually in every group. Create one stop-word list, add “scam”, and assign that list to the target groups.
2. Where to configure rules
Main panel sections:
Groups— connected groups and bot permission checks.Stop words— words and phrases that should trigger deletion.Required words— words or phrases that must be present in a message.Links— link and domain rules.Message limits— per-user message limits.Greetings— welcome messages for new members.Billing— balance and active paid groups.
If a rule does not work, check three things first: the group is connected, the bot has required permissions, and the rule is assigned to that group.
3. Stop words
Use stop words when a message should be removed because it contains a banned word or phrase.
Example: you want to block the word cat.
Add this stop word:
catAfter that, the bot should delete messages where this word appears in a normal or disguised form.
Examples that should be deleted:
- cat
- Cat
- cAt
- cA.t
- c.a.t
- c-a-t
- c a t
- C.A.T!!!
- buy cat now
This works because message text is normalized before checking: letter case is ignored, and non-letter separators are removed.
4. Required words
Use required words when each message must include a specific word or phrase. This is useful for classified posts, vacancies, forms, and template-based publishing.
Example: a classified ads group.
- London
- Berlin
- Dubai
This message passes: “Selling a bicycle, London, pickup only.”
This message may be deleted: “Selling a bicycle, DM me.”
Why: the message does not contain any required word from the list.
Example: a job group.
- salary
- rate
- payment
This message passes: “Looking for a designer, payment weekly.”
This message may be deleted: “Looking for a designer, details in DM.”
Important: required-word rules check regular new messages. Replies may be ignored by this rule so normal discussion under posts is not broken.
5. Links
Link rules control which links are allowed in a group.
Example 1: block all links.
Message: “Details here: example.com”
Result: the bot deletes the message.
Example 2: block only selected domains.
- spam-site.com
- fake-shop.com
Message: “Discounts here: spam-site.com”
Result: the bot deletes the message.
Example 3: allow only approved domains.
- yoursite.com
- docs.google.com
- t.me/yourchannel
A message with yoursite.com passes. A message with an unknown domain is deleted.
For testing, use visible links such as example.com or https://example.com. If a link is hidden behind Telegram linked text, it is also checked as a link.
6. Message limits
Message limits reduce flood when one user sends too many messages in a short time.
Example: limit flooding.
You want one user to send no more than 5 messages in 30 seconds.
Set the limit:
- 5 messages
- 30 seconds
If the user writes normally, messages stay. If they quickly send the 6th, 7th and 8th message, extra messages are deleted.
Tip: start with a soft limit. A strict limit may interrupt normal discussion.
7. Greetings
Greetings are sent automatically to new group members.
Welcome message example:
Hi, {first_name}! Please read the group rules before posting.
If Anna joins the group, the bot sends:
Hi, Anna! Please read the group rules before posting.
Use {first_name} in message text. If first name is missing, the bot uses your fallback value from welcome-message settings.
Use greetings for group rules, pinned message links, or a short explanation of what members can post.
8. Mass actions
Example: the same spammer appears in multiple groups.
- Find the offender’s message.
- Reply to that message with
/banall. - The bot tries to ban that user in connected groups where it has the required permissions.
Use /muteall for restriction instead of a full ban.
Important: /banall and /muteall must be sent as a reply to the user’s message. If you send the command as a separate message, the bot does not know which user to restrict.
9. Reply, forwarded messages and topics
- Regular messages go through all primary checks.
- Replies can be skipped by required-word checks.
- Stop words and links can still apply to replies.
- A topic message with
message_thread_idis not a reply by itself. - A forwarded message without
reply_to_messageis treated as regular message.
10. Bot permissions
To remove violating messages, the bot must be an admin and have can_delete_messages. This affects stop words, required words, link rules and message limits.
For /banall and /muteall, bot also needs can_restrict_members.
If rights changed in Telegram, open Groups and run Check bot.
11. How to test before network-wide rollout
- Connect one test group.
- Check bot status in
Groups. - Create one simple stop word.
- Assign that list to the group.
- Send a message with that stop word.
- Confirm message was removed.
- Create a simple required-word rule.
- Send a regular message without required word.
- Send a reply without required word and verify expected behavior.
- Send a message with a link.
- Test message limit behavior.
- After validation, assign rules to other groups.
12. Common issues
Rule was created but not assigned
Creating a rule is not enough. You must assign target groups.
Bot cannot delete messages
Grant delete permission in Telegram and refresh status with Check bot.
Test is done in a reply
Test required-word behavior on a new standalone message, not on reply.
Link is hidden behind linked text
The hidden URL is still checked by link rules. Test both visible and hidden links.
Rule was changed just now
Wait briefly and retest.
Rule is assigned to a different group
Recheck assignments and exact target group.
13. When to scale to multiple groups
Do not roll out a new rule to the full network before validating it in one group.
Recommended order:
- Configure rule in one group.
- Validate regular message behavior.
- Validate reply behavior if relevant for your flow.
- Validate link behavior.
- Recheck bot permissions.
- Only then assign rule to the rest of groups.
This prevents a misconfigured rule from affecting all groups at once.