DEV Community

Discussion on: Sending messages with Telegram bot

Collapse
 
tech2blog profile image
Tech2Blog.com

Try to add the bot to the group and then try the command.

Collapse
 
karataev profile image
Eugene Karataev

The bot was in the group, but the request in Postman failed 🤷‍♀️

Thread Thread
 
tech2blog profile image
Tech2Blog.com

Strange, mine was also failing, but after adding to the group issue was resolved. Just check if the bot has admin privilege.

Also, try with curl once.

Thread Thread
 
karataev profile image
Eugene Karataev

Oh, I think I figured out the difference in results between Postman and browser requests.
Telegram servers are blocked here in Russia, that's why Postman requests fail. But in the browser I use VPN extension and the request resolves as expected.
Thanks for your help 😉

Thread Thread
 
rizkyrajitha profile image
Rajitha Gunathilake

wow , that's some serious debugging.
for me the results came after i added the bot to the group and then i send some messages to the group. so there is some data to show.

Thread Thread
 
karataev profile image
Eugene Karataev

Yeah, but in normal situation even if you don't add the bot to the group and send request https://api.telegram.org/bot<token>/getUpdates, you'll get an emtpy response like {"ok":true,"result":[]}.
In the case of access restriction on a government level, there is no response in Postman at all.
no response

Thread Thread
 
rizkyrajitha profile image
Rajitha Gunathilake

thanks 👍