Answer the question
In order to leave comments, you need to log in
Telegram Bot Api How to send a message to a private channel through a bot?
Actually I'm trying to check with a regular http request through a browser, but it doesn't work out that way. Who can tell me how to correctly specify the type of chat?
https://api.telegram.org/bot/sendMessage? chat_type=private &chat_id=AlA_...5FA&text=Blablacar
Here's what's in the API "type String Type of chat, can be either “private”, “group”, “supergroup” or “channel”"
Ps there is no problem with a public channel.
Answer the question
In order to leave comments, you need to log in
I know how to do it!
1. Make the channel public, set a username for it.
2. Add any bot to the channel.
3. Follow the link
https://api.telegram.org/bot[ТОКЕН_БОТА]/[email protected][USERNAME_КАНАЛА]&text=тест
. After clicking on the link, the channel id will be displayed, save it. https://api.telegram.org/bot[ТОКЕН_БОТА]/[email protected][ID_КАНАЛА]&text=тест.
In a telegram, bots can write not only by username, but also by id to channels. I would go in that direction.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question