Skip to content
Snippets Groups Projects
Commit 15f1c441 authored by Dominic Krämer's avatar Dominic Krämer
Browse files

improve api call message

parent 655fc666
Branches main
No related tags found
No related merge requests found
...@@ -58,6 +58,15 @@ def find_location(timestamp): ...@@ -58,6 +58,15 @@ def find_location(timestamp):
return smaller_entry return smaller_entry
def format_timestamp(location):
parts = location.split(" ")
answer = f"The ISS at time: {parts[0]} will be at:\n \
x: {parts[1]}\n \
y: {parts[2]}\n \
z: {parts[3]}\n"
return answer
class ActionCurrentIssLocation(Action): class ActionCurrentIssLocation(Action):
def name(self) -> Text: def name(self) -> Text:
...@@ -69,8 +78,8 @@ class ActionCurrentIssLocation(Action): ...@@ -69,8 +78,8 @@ class ActionCurrentIssLocation(Action):
download_file() download_file()
location = find_location(str(datetime.now())) location = find_location(str(datetime.now()))
location = format_timestamp(location)
dispatcher.utter_message(text=f"location: {location}") dispatcher.utter_message(text=f"{location}")
return [] return []
...@@ -91,7 +100,8 @@ class ActionFutureIssLocation(Action): ...@@ -91,7 +100,8 @@ class ActionFutureIssLocation(Action):
else: else:
entity = tracker.latest_message['entities'][0]['value'] entity = tracker.latest_message['entities'][0]['value']
location = find_location(entity) location = find_location(entity)
dispatcher.utter_message(text=f"location: {location}") location = format_timestamp(location)
dispatcher.utter_message(text=f"{location}")
return [] return []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment