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