M
M
misha0572021-11-18 16:07:40
Messengers
misha057, 2021-11-18 16:07:40

Why messages only come to one Telegram bot instance?

Created a bot in Telegram (via Botfather). I send messages to it from the computer with the following line:

https://api.telegram.org/bot<Token>/sendMessage?chat_id=<ChatID>&text=Hello.

Messages come to your phone where the bot was created, but there are no messages to other phones that have added a bot to themselves. Why and how to make messages visible to everyone who has a bot added?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
misha057, 2021-11-19
@misha057

Understood. For those who are interested:
1. Create a bot through Botfather, press START. During the creation process, BotFather will issue a unique Token.
2. In the browser, execute

https://api.telegram.org/bot[ТОКЕН_БОТА]/getUpdates
, find the chat id.
3. The bot can already receive messages
https://api.telegram.org/bot[ТОКЕН_БОТА]/sendMessage?chat_id=[ChatID]&text=Hello.

If we want to send these messages to a group of people:
4. Create a group (public), add a bot there.
5. Open the link in the browser:
https://api.telegram.org/bot[ТОКЕН_БОТА]/[email protected][USERNAME_ГРУППЫ]&text=тест
, we get the group id (it is negative).
6. Now you can send messages to the group:
https://api.telegram.org/bot[ТОКЕН_БОТА]/[email protected][ID_КАНАЛА]&text=тест

7. The group can be made private.

A
Alex_mos, 2021-11-18
@Alex_mos

Why and how to make messages visible to everyone who has a bot added?

Maybe you need to create a group and add a bot there that will send messages to the chat. And these messages will be seen by everyone who has this chat.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question