TSocial TSocial
Open in Telegram
Better in TelegramOpen in Telegram

Bot Privacy Mode and Group Admin Rights Explained

· 4 min read · 18+ readers

Bot Privacy Mode and Group Admin Rights Explained: TSocial guide cover card

A common surprise: you add your bot icon bot to a group and it ignores most messages. The cause is usually safety icon privacy mode, a setting that limits what bots see in groups. This guide explains the rules, how to change them and how admin rights interact. Confirm the details in the Bot API documentation, in the section about privacy mode.

What privacy mode does

When privacy mode is on, which is the default for new bots, a bot in a group receives only:

  • Commands addressed to it, for example /start@yourbot, and, in many cases, plain commands sent in the group.
  • Replies to its own messages.
  • Messages that mention it by username.
  • Service messages such as someone joining, where relevant.
  • Messages from other bots, subject to the documentation.

It does not receive ordinary conversation. This protects users, because most bots do not need to read everything.

When you need privacy mode off

Turn it off when the bot must read all messages, for example:

  • Spam filters and moderation bots.
  • Bots that react to keywords.
  • Logging or summarising a group.

In BotFather, send /setprivacy, choose the bot and choose Disable. After changing privacy mode, Telegram says you must remove and re-add the bot to each existing group for the new setting to apply. Do that, or the bot will keep its old view.

Admin rights also change what a bot sees

A bot that is a group administrator receives all messages, regardless of privacy mode. This is why moderation bots are usually admins. Admin rights are a set of permissions that the person adding the bot grants, such as:

  • Delete messages.
  • Ban or restrict users.
  • Pin messages.
  • Invite users.
  • Manage topics and stories, where available.
  • Remain anonymous.

Grant the minimum a bot needs. A welcome bot that only posts does not need to ban people. Method names that need rights include deleteMessage, banChatMember, restrictChatMember and pinChatMessage. If a call fails with a message such as "not enough rights", the bot lacks the permission.

Allowed updates in groups

Some update types are not delivered unless you ask. For example, to track members joining or leaving, include chat_member in allowed_updates when you call getUpdates or setWebhook. The bot must also be an admin for those updates. my_chat_member tells you when the bot itself was added or removed.

Checking what the bot can do

Use getChatMember with the bot's own id to read its status and rights in a chat:

{ "chat_id": -1001234567890, "user_id": 111222333 }

The response lists status and flags such as can_delete_messages. Use it during setup to warn the owner when rights are missing.

Allowing and blocking groups

/setjoingroups in BotFather decides whether the bot can be added to groups. Turn it off for bots that should only work in private chats.

Supergroups and topics

Large groups are supergroups, with negative ids that begin with -100. Groups with topics have a message_thread_id. Reply in the same thread by passing that id. If you ignore it, your message lands in the General topic.

Testing

  1. Create a test group with a second account.
  2. Add the bot with privacy mode on and write a normal message. The bot should not see it.
  3. Mention the bot, and it should see that message.
  4. Turn privacy off, remove and re-add the bot, and test again.
  5. Make the bot admin and test deleteMessage.

See testing with a second account.

Privacy and trust

If your bot reads all messages, tell the group. Explain what it stores, for how long, and who can see it. Do not log private conversations without need. Pin a short notice and give admins a way to remove the bot.

Quick checklist

  • Decide if the bot really needs to read all messages.
  • Privacy mode disabled only when required.
  • Bot removed and re-added after changing privacy mode.
  • Admin rights limited to what the bot uses.
  • chat_member added to allowed_updates if you track joins.
  • getChatMember used to check the bot's own rights.
  • The group is told what the bot stores.
  • Admins know how to remove the bot.

Communicate with the group

Members are more relaxed when they know what a bot does. Pin a short note naming the bot, its purpose, what it logs and who can read the logs. When you make a change, such as enabling message reading, announce it first.

Frequently asked questions

Why does my bot ignore normal messages?

Privacy mode is on and the bot is not an admin. Disable privacy or promote the bot.

Do I need to re-add the bot after changing privacy?

Yes, according to the documentation.

Can a bot see messages sent before it joined?

No. Bots do not receive old history.

Can a bot read channel posts?

Bots that are admins of a channel megaphone icon channel receive channel posts as channel_post updates. See adding a bot to a channel.

Related guides

More in Build on Telegram

All topics: Build on Telegram · Guide index · Explore Telegram · About TSocial

Bot Privacy Mode and Group Admin Rights Explained | TSocial