alanchen1115 commited on
Commit
3bf6983
1 Parent(s): e89f9a9

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -2
main.py CHANGED
@@ -36,7 +36,7 @@ def root():
36
  async def webhook(request: Request, x_line_signature: str = Header(None)):
37
  body = await request.body()
38
  try:
39
- line_handler.handle(body.decode(), x_line_signature)
40
  except InvalidSignatureError:
41
  raise HTTPException(status_code=400, detail="chatbot handle body error.")
42
  return 'OK'
@@ -58,4 +58,7 @@ def handle_message(event):
58
  out = "不懂您的意思!"
59
  line_bot_api.reply_message(
60
  event.reply_token,
61
- TextSendMessage(text=out))
 
 
 
 
36
  async def webhook(request: Request, x_line_signature: str = Header(None)):
37
  body = await request.body()
38
  try:
39
+ line_handler.handle(body.decode("utf-8"), x_line_signature)
40
  except InvalidSignatureError:
41
  raise HTTPException(status_code=400, detail="chatbot handle body error.")
42
  return 'OK'
 
58
  out = "不懂您的意思!"
59
  line_bot_api.reply_message(
60
  event.reply_token,
61
+ TextSendMessage(text=out))
62
+
63
+ if __name__ == "__main__":
64
+ uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=True)