Use Telegram client for bot testing (not bot api)

Punnerud picture Punnerud · Apr 27, 2016 · Viewed 7.5k times · Source

I am build a Telegram Bot now and are testing it manually with a Telegram Client. Is there a way I can send client messages in the same way I can build bots?

I know that I could build unit-tests in the code, that is not what I am looking for.

Answer

Jehy picture Jehy · Feb 27, 2017

I asked the same question and did not find an answer. So I made two libraries for testing telegram bots:

  1. telegram-test can be used if you made bot using node-telegram-bot-api. It catches bot requests and allows to pretend that we have a valid answer from client.
  2. telegram-test-api can be used with any bot and any technological stack. It is a web server which emulates Telegram API. You can make client requests to it using any client, protocol is very simple.

Both projects are in deep alpha version for now but I haven't seen anything better. You can read an article about those projects (in Russian) here.