Skip to content
TGWAY
Channels & Bots STEP 74 / 99

Telegram Bot Privacy Mode: How Much a Bot Sees in Groups

In groups, a bot with privacy mode on gets only its commands, replies and service messages. When to use admin rights or /setprivacy, and how to work with it.

  • Applies toDevelopers
  • LevelL4
  • Reading time3 min
  • Verified

The short answer

  1. 1By default a bot in a group receives only its commands, replies to it and service messages.
  2. 2For everything, make it an admin or turn privacy off with /setprivacy, then re-add it.
  3. 3force_reply and inline buttons work whatever the mode.
In this article
  1. By default a bot gets only what concerns it
  2. When your bot needs every message
  3. Before you turn it off
  4. Design the bot to work in privacy mode
  5. FAQ
  6. At a glance

By default a bot gets only what concerns it

Adding a bot to a group does not hand it the whole conversation. Telegram bots have privacy mode turned on by default, and in that mode a bot receives only the messages related to it.

Received in privacy modeExample
Commands addressed to that bot/help@your_bot
General commands, if this bot was the last to postA /cancel right after the bot asked something
Replies to the bot's own messagesA member using Reply on the bot's question
Messages sent via that botA result picked with @your_bot query
Service messagesMembers joining or leaving, pinned messages

To see which mode your bot is in, call getMe: can_read_all_group_messages is false when privacy mode is on. See your first Bot API requests.

When your bot needs every message

MethodResultWhen
Make the bot an adminReceives all messages whatever its privacy settingBots that run the group: deleting banned words, checking new members
Turn privacy mode offReceives all messages without being an adminOnly when it has to read the conversation but needs no admin rights

To turn it off, choose your bot in @BotFather, send /setprivacy and pick Disable. The change does not apply to groups the bot is already in. Remove the bot from each group and add it again.

Before you turn it off

The official documentation recommends turning privacy mode off only when you really need to. In the group's member list, a bot with privacy off is shown as having access to messages, which can make members uneasy. Receiving everything also makes you responsible for everything you receive: process only the messages you need and do not store the rest.

If you run the group rather than the bot, check what each bot can see before you add it or make it an admin; see bot accounts vs user-account automation and what inline bots can and cannot see.

Design the bot to work in privacy mode

  • Questions that need an answer: send them with force_reply. The user's app starts a reply to the bot's message automatically, so the answer reaches the bot even in privacy mode.
  • Commands in groups: tell members to use the /command@your_bot form; see registering bot commands.
  • Choices: collect them with inline buttons. Button taps reach the bot whatever the privacy setting; see bot buttons.

FAQ

Why doesn't my Telegram bot receive group messages?

Privacy mode is on by default, so it only receives commands, replies to its messages and service messages.

How do I turn off privacy mode for my bot?

Send /setprivacy to @BotFather, pick your bot and choose Disable, then remove the bot from the group and add it again.

Can members tell if a bot reads all messages?

Yes. The group member list shows whether a bot has access to messages.

Sources

Summary

At a glance

Telegram Bot Privacy Mode: How Much a Bot Sees in Groups — at a glance illustration
  1. 1Default

    Privacy mode on: only messages related to the bot.

  2. 2All messages

    Admin rights, or /setprivacy Disable and re-add the bot.

  3. 3Design

    force_reply, /command@bot and inline buttons.

Share this guide

Send it to a friend who has the same question.

Telegram WhatsApp
More

Open on your phonePoint your phone camera here to open this guide.

Updated

Related articles

View all ›