Botxona

How to set up an anti-spam bot for your Telegram group

The biggest problem in large open Telegram groups is ads, spam links and promotional messages forwarded from other channels. Deleting them by hand is exhausting, especially in an active group. This guide shows how to add the ready-made Group Guard (Guruh qo'riqchisi) bot to your group — without writing any code.

What the bot does

Group Guard checks every message in the group and automatically deletes links (websites, t.me), forwards from other channels/groups, @username ads and any banned words you define. Repeat offenders get a warning, and once they hit the limit they are muted, kicked or banned permanently — your choice. There's also an optional captcha for new members, which keeps spam bots from posting in the group at all.

Steps

1. Get a token from @BotFather

Open @BotFather in Telegram, send /newbot, and give your bot a name and username. At the end, copy the token you're given and never share it. More: Getting a token.

2. Launch the bot from the catalog

Go to the Group Guard page and click "Launch for free" (the bot works fully on the Free plan too). Enter your token.

3. Fill in the basic settings

The most important field is "Bot owners (ID)": enter your own Telegram ID here (the form suggests it automatically). These IDs are the only people who can control the bot. Optionally, enable "Only my groups" so that only you can add the bot to a group.

4. Tune the protection settings

The form gives you options: delete links, block forwards, delete @username ads, a banned words list, and a flood (rapid posting) limit. You can leave the defaults to start — and change them any time later under "Settings". If some websites should be allowed in your group (e.g. your own site), add them to the "Allowed sites" field.

5. Choose the penalty

With the "Warning limit" and "Penalty type" (mute / kick / ban) settings, you decide after how many violations action is taken, and what kind. To start gently, we recommend "Mute".

6. Add the bot to the group as an admin

Once the bot is running, a link to add it to a group appears on the bot page. When you click it, Telegram asks you to choose a group — the bot is added as an admin automatically with only the two rights it needs (delete messages and restrict members); no extra rights are requested.

7. Check the settings in the group

Send the /sozlamalar command in the group (as a group admin) to confirm protection is enabled. If you need a captcha, you turn it on here too.

8. Test it

From a second Telegram account, post a link in the group — the message should be deleted automatically. Join the group as a new member to check that the captcha works.

Useful commands

For group admins: /warn (issue a warning, as a reply to a message), /mute, /kick, /ban and their reverses /unwarn, /unmute, /unban. Use /warns to see how many warnings each member has. Full list on the Group Guard page.

Does it work on the free plan?

Yes — Group Guard works fully as part of the Free plan: no card required, just 256 MB of RAM and limited resources. If the server needs resources and the bot has been idle for a long time (no messages in the group for a while), it may be put to sleep and wakes up within a few seconds on the next message — not noticeable for typical moderation. The bot's messages (e.g. the welcome message) end with a small "🤖 Botxona.uz" link; you can remove it by switching to a paid plan at any time.

Against hidden ads and new tricks

Spammers change tactics often: text written over an image instead of a plain link, hidden links (a link concealed under text), or several messages in a row to slip past filters. Group Guard detects hidden links too (invisible links in the message text), checks forwarded messages regardless of their source, and through the "Flood limit" setting treats sending many messages in a short time as suspicious in itself and mutes the sender automatically. If a particular word or phrase (e.g. a competitor's brand name) keeps showing up as spam in your group, just add it to the "Banned words" list — matching is case-insensitive.

Managing several groups with one bot

If you run several groups (e.g. split by neighborhood, product or region), you can add a single bot to all of them — even with one token, each group gets its own independent settings: captcha can be on in one and off in another. Use the /guruhlar command (in a private chat, as the owner) to see a list of all the groups under your control.

FAQ

What if the bot deletes the wrong message?

Loosen the settings — for example, add the domains you need to the "Allowed sites" list, or turn off "Delete @username ads" if it interferes with members' normal conversations.

Does the bot work in multiple groups?

Yes, one bot can work in an unlimited number of groups, and each group has its own settings (via /sozlamalar).

If I remove the bot from a group, do I lose my settings?

Group settings are kept — if you add the bot back, it continues with the previous settings.