Spaces:
Sleeping
Sleeping
Update main.py
Browse files12341 unmodified line67891011127 unmodified lines202122232425262728#import httpxfrom fastapi import FastAPI, Requestfrom fastapi.middleware.cors import CORSMiddleware # Importa il middleware CORSimport requests1 unmodified lineTOKEN = "6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU"BASE_URL = f"https://api.telegram.org/bot{TOKEN}"#client = httpx.AsyncClient()app = FastAPI()app.add_middleware(7 unmodified lines#https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/@app.post("/")def webhook(data: dict):print(data)requests.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")#requests.get("http://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")#chat_id = data['message']['chat']['id']#text = data['message']['text']12341 unmodified line67891011127 unmodified lines20212223242526272829import httpxfrom fastapi import FastAPI, Requestfrom fastapi.middleware.cors import CORSMiddleware # Importa il middleware CORSimport requests1 unmodified lineTOKEN = "6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU"BASE_URL = f"https://api.telegram.org/bot{TOKEN}"client = httpx.AsyncClient()app = FastAPI()app.add_middleware(7 unmodified lines#https://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/setWebhook?url=https://matteoscript-TelegramBotSimple.hf.space/@app.post("/")async def webhook(data: dict):print(data)await client.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")#requests.get("https://script.google.com/macros/s/AKfycbxa8wXSr1ynlEONQ99s3WF5a9OTHSYWH7NkKsYI9Z2SeWRoU5c0-WzjY5Gn2iDhSgj5/exec")#requests.get("http://api.telegram.org/bot6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU/sendMessage?chat_id=1738997897&text=Come_Stai_Vez")#chat_id = data['message']['chat']['id']#text = data['message']['text']
main.py+5-4