Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -11,9 +11,13 @@ app = FastAPI()
|
|
11 |
@app.post("/webhook/")
|
12 |
async def webhook(req: Request):
|
13 |
print('a')
|
14 |
-
data = await req.
|
15 |
print(data)
|
16 |
chat_id = data['message']['chat']['id']
|
17 |
text = data['message']['text']
|
18 |
await client.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
|
19 |
-
return data
|
|
|
|
|
|
|
|
|
|
11 |
@app.post("/webhook/")
|
12 |
async def webhook(req: Request):
|
13 |
print('a')
|
14 |
+
data = await req.()
|
15 |
print(data)
|
16 |
chat_id = data['message']['chat']['id']
|
17 |
text = data['message']['text']
|
18 |
await client.get(f"{BASE_URL}/sendMessage?chat_id={chat_id}&text={text}")
|
19 |
+
return data
|
20 |
+
|
21 |
+
@app.get("/")
|
22 |
+
def read_general():
|
23 |
+
return {"response": "Started"}
|