Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -19,13 +19,13 @@ app.add_middleware(
|
|
19 |
|
20 |
#https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/
|
21 |
|
22 |
-
@app.post("/")
|
23 |
def webhook(data: dict):
|
24 |
print(data)
|
25 |
-
chat_id = data['message']['chat']['id']
|
26 |
-
text = data['message']['text']
|
27 |
-
resp = requests.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
|
28 |
resp = requests.get("https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")
|
|
|
29 |
print(resp)
|
30 |
#await client.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
|
31 |
return {"response": "ok"}
|
|
|
19 |
|
20 |
#https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/
|
21 |
|
22 |
+
@app.post("/webhook")
|
23 |
def webhook(data: dict):
|
24 |
print(data)
|
25 |
+
#chat_id = data['message']['chat']['id']
|
26 |
+
#text = data['message']['text']
|
|
|
27 |
resp = requests.get("https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")
|
28 |
+
#resp = requests.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
|
29 |
print(resp)
|
30 |
#await client.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
|
31 |
return {"response": "ok"}
|