DEV Community

Discussion on: Sending messages with Telegram bot

Collapse
 
rizkyrajitha profile image
Rajitha Gunathilake

this might help you

Send a message to your bot then retrieve the update with:

https://api.telegram.org/bot<BOTID>/getUpdates

In the json string returned you will find you chat_id/user_id.
In single chat with the bot chat_id is equal to user_id.
Now you can send your message with:

https://api.telegram.org/bot<BOTID>/sendMessage?chat_id="yourchatid"&text="Hello!"

stackoverflow.com/a/32777943/9374003