Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -3,7 +3,7 @@ from fastapi import FastAPI, Request
|
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware # Importa il middleware CORS
|
| 4 |
import requests
|
| 5 |
|
| 6 |
-
TOKEN = "
|
| 7 |
BASE_URL = f"https://api.telegram.org/bot{TOKEN}"
|
| 8 |
|
| 9 |
client = httpx.AsyncClient()
|
|
@@ -17,12 +17,15 @@ app.add_middleware(
|
|
| 17 |
allow_headers=["*"],
|
| 18 |
)
|
| 19 |
|
| 20 |
-
#https://api.telegram.org/
|
| 21 |
|
| 22 |
@app.post("/")
|
| 23 |
def webhook(data: dict):
|
| 24 |
-
print(data)
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
#await client.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")
|
| 27 |
#requests.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")
|
| 28 |
#requests.get("http://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")
|
|
|
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware # Importa il middleware CORS
|
| 4 |
import requests
|
| 5 |
|
| 6 |
+
TOKEN = "6907051705:AAHZtYuiFTkQBNNw6m3cBVns8BPUw5mvxgU"
|
| 7 |
BASE_URL = f"https://api.telegram.org/bot{TOKEN}"
|
| 8 |
|
| 9 |
client = httpx.AsyncClient()
|
|
|
|
| 17 |
allow_headers=["*"],
|
| 18 |
)
|
| 19 |
|
| 20 |
+
#https://api.telegram.org/bot6907051705:AAHZtYuiFTkQBNNw6m3cBVns8BPUw5mvxgU/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/
|
| 21 |
|
| 22 |
@app.post("/")
|
| 23 |
def webhook(data: dict):
|
| 24 |
+
print('data)
|
| 25 |
+
print(f"\n{datetime.now()}: INIZIO")
|
| 26 |
+
time.sleep(20)
|
| 27 |
+
print(f"\n{datetime.now()}: FINE")
|
| 28 |
+
requests.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")
|
| 29 |
#await client.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")
|
| 30 |
#requests.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")
|
| 31 |
#requests.get("http://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")
|