How to talk TO telegram bot programmaticaly (via API)?

Viewed 26

Official Telegram API explains how to send messages from Telegram Bot via API to:

  • real users
  • channels
  • groups

But it is unclear how to read messages from the bot and reply to them programmaticaly.

Use case

There is a bot that shows weather in the city you ask.
You want to make "HTTP gateway" to that bot:

  • user sends HTTP request to /weather?city=London
  • backend send message to Telegram bot
  • Telegram bot answers "rainy"
  • backend reads message from the Telegram bot
  • backend returns "rainy" to user

Possible solution

There are projects that emulate Telegram clients using MTProto protocol:

But they warn that this may violate Telegram rules and you may be banned.

Is there any nicer solution?

0 Answers
Related