added try-catch, removed push message, renamed file
This commit is contained in:
parent
6a06ec4cec
commit
b682911383
|
|
@ -1,3 +1,4 @@
|
|||
srv_secrets.py
|
||||
venv/
|
||||
chroma_db/
|
||||
chroma_db/
|
||||
__pycache__/
|
||||
|
|
@ -111,11 +111,9 @@ def message_text(event):
|
|||
|
||||
with ApiClient(configuration) as api_client:
|
||||
line_bot_api = MessagingApi(api_client)
|
||||
line_bot_api.push_message_with_http_info(
|
||||
PushMessageRequest(
|
||||
to=event.source.user_id,
|
||||
messages=[TextMessage(text=str(user_sessions[event.source.user_id]({"question": event.message.text})['answer']))]
|
||||
))
|
||||
with str(user_sessions[event.source.user_id]({"question": event.message.text})['answer']) as answer:
|
||||
line_bot_api.push_message_with_http_info(
|
||||
PushMessageRequest(to=event.source.user_id,messages=[TextMessage(text=answer)]))
|
||||
|
||||
# main is here
|
||||
if __name__ == "__main__":
|
||||
Loading…
Reference in New Issue