Answer the question
In order to leave comments, you need to log in
How to send a message to telegram from my site, just by clicking on a button?
My site has a button and a message box. Is it possible through the telegram api to make the message from this field be sent to me on telegram and how? The user does not have to run anything on his computer or phone, he may not even have a telegram account. I just pressed the button and the message was sent.
Answer the question
In order to leave comments, you need to log in
Can. Create a bot, subscribe to it.
When a user clicks a button on the site, send a request from the site to the telegram api so that the bot sends you a message.
https://core.telegram.org/bots
method https://core.telegram.org/bots/api#sendmessage
chat_id is your personal telegram id.
You can find it out very simply - we get messages from the bot that users write to it, how to do this is written https://core.telegram.org/bots/api#getting-updates
The chat_id of the author is visible in the message. Accordingly, write something to the bot, see your chat_id, hardcode it in the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question