Spaces:
Sleeping
Sleeping
Update main.py
Browse files18 unmodified lines192021222223242526272526272829303118 unmodified lines
#https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/
@app.post("/")@app.post("/webhook")def webhook(data: dict): print(data) chat_id = data['message']['chat']['id'] text = data['message']['text'] resp = requests.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}") #chat_id = data['message']['chat']['id'] #text = data['message']['text'] resp = requests.get("https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez") #resp = requests.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}") print(resp) #await client.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}") return {"response": "ok"} main.py+4-4