Spaces:
Running
Running
File size: 606 Bytes
2df0239 002fca8 d707be1 23d7e0d 11c5c73 2df0239 11c5c73 23d7e0d 6159237 2df0239 23d7e0d 2df0239 23d7e0d 2df0239 79f7735 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#import httpx
from fastapi import FastAPI, Request
TOKEN = "6770617809:AAEhytQUOl3uZOFINVE7-o0KkIoAz8perGU"
BASE_URL = f"https://api.telegram.org/bot{TOKEN}"
#client = httpx.AsyncClient()
app = FastAPI()
@app.post("/")
def webhook(req: Request):
print('a')
print(req)
return {"response": "TEST"}
'''data = await req()
print(data)
chat_id = data['message']['chat']['id']
text = data['message']['text']
await client.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
return data'''
@app.get("/")
def read_general():
return {"response": "Started"} |