Answer the question
In order to leave comments, you need to log in
How to send an application from the site to Telegram?
it is necessary that when filling out the form on the site, the data when entered is sent to the telegram bot. I saw scripts in js and php, but I need to do it in python
Answer the question
In order to leave comments, you need to log in
For a similar task, I use cloud functions in the Yandex cloud. The python script accepts an HTTP request and redirects the necessary data to my cart. It's free for small amounts per month.
I'm not a pythonist at all) But isn't that how it's done?!
import requests
def send_msg(text):
token = "your_token"
chat_id = "your_chatId"
url_req = "https://api.telegram.org/bot" + token + "/sendMessage" + "?chat_id=" + chat_id + "&text=" + text
results = requests.get(url_req)
print(results.json())
send_msg("Hello there!")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question