How to receive messages in group chats using telegram bot api

By default A Bot will receive only messages addressed to it by any user directly via posting by /command@YourBot any message you send. After that it vill be available via getUpdates API call. In browser it will be:

https://api.telegram.org/botToken/getupdates

Find the related message in output JSON and grab chatId. It will allow you to answer back with:

https://api.telegram.org/botToken/sendmessage?chat_id=123456788&text=My Answer

Talk to @botfather and disable the privacy mode.


Sequence within a BotFather chat:

You: /setprivacy

BotFather: Choose a bot to change group messages settings.

You: @your_name_bot

BotFather: 'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.

'Disable' - your bot will receive all messages that people send to groups.

Current status is: ENABLED

You: Disable

BotFather: Success! The new status is: DISABLED. /help


Make your bot by admin in group.

Tags:

Telegram Bot