A
A
Anton2021-10-22 23:48:33
PHP
Anton, 2021-10-22 23:48:33

How to make a telegram bot to receive messages from a site in PHP?

There was a question of sending messages to the cart. How can this be done with php?
There is a front, it sends a request to the url with parameters, on this url there is a php file with a script. Maybe someone saw guides or ready-made solutions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Areso, 2021-10-23
@Ooos

Several variants.
Use https://habr.com/ru/company/netologyru/blog/326174/ tutorial.
Use the requests for php library ( https://requests.ryanmccue.info/ ) , and then just pull:
$url = ' https://api.telegram.org/bot ' + $bot_token;
$url += '/sendMessage?chat_id=' + $bot_chatID + '&parse_mode=Markdown&text=' + $bot_message;
well, or pull curl from php
chatId, look at the page
https://api.telegram.org/bot"bot_token"/getUpdates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question