Use Telegram client for bot testing (not bot api)

前端 未结 2 811
一整个雨季
一整个雨季 2021-02-09 01:28

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

相关标签:
2条回答
  • 2021-02-09 01:57

    Alternatively you can use an MTProto Telegram user account library like MadelineProto in PHP, Telethon and Pyrogram in Python 3. You can use these library to automate an user account to test your bot.

    Just to note that you might hit the flood ban if you send message too frequently.

    0 讨论(0)
  • 2021-02-09 01:59

    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.

    0 讨论(0)
提交回复
热议问题