A
A
Alexander2021-01-28 05:15:51
Python
Alexander, 2021-01-28 05:15:51

How do similar systems for telegram chat bots work?

Hello, this question arose, I am doing a small service for creating chat bots. Can you tell me how adding and listening to the added bots is implemented or give some ideas?
I want to implement the addition in this way:
1) The user creates a bot in telegrams and receives its token.
2) Introduces a token into my service, I save it.
3) ??? (Here's the catch, how to listen to all bots for events that users add)
I would be grateful for the ideas. And what is better to use hooks or polling in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2021-01-28
@AlexMine

call the method with the bot token setWebhook()( documentation ) and assign the URL of your server where notifications of this particular bot will come. For example https://api.example.com/webhook/{bot_id}where bot_id is the id of the bot in your database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question