MatteoScript commited on
Commit
79f7735
·
verified ·
1 Parent(s): 23d7e0d

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
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.json()
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"}