Spaces:
Sleeping
Sleeping
| #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() | |
| 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''' | |
| def read_general(): | |
| return {"response": "Started"} |