Ian Peres
Ian Peres

Reputation: 35

Reply to multiple users telegram (Message Id) PHP Bot

I have question, When I send a message from my api to several users, the message_id is the same for all users or each chat have a different id?

because when I try to send a reply to all my user I get this error

https://api.telegram.org/mytoken/sendMessage?chat_id=loopIDs&parse_mode=HTML&text=test&reply_to_message_id=1338

request failed! HTTP/1.1 400 Bad Request in ...

{ "ok": false, "error_code": 400, "description": "Bad Request: reply message not found" }

the message id I get it when I send the request to telegram api.

Upvotes: 1

Views: 2522

Answers (1)

tashakori
tashakori

Reputation: 2441

each message has a different id, and you should reply to each message of any user separately.

https://api.telegram.org/mytoken/sendMessage?chat_id=user1ID&parse_mode=HTML&text=test&reply_to_message_id=user1MessageID
https://api.telegram.org/mytoken/sendMessage?chat_id=user2ID&parse_mode=HTML&text=test&reply_to_message_id=user2MessageID

Upvotes: 2

Related Questions