Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[google_chat_ros] check whether google_chat_button's parameters inclu… #501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions google_chat_ros/scripts/google_chat_ros_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,11 @@ def event_cb(self, event, publish_topic=True):
action = event.get('action')
msg.action.action_method_name = action.get('actionMethodName')
if action.get('parameters'):
parameters = []
for param in action.get('parameters'):
action_parameter = ActionParameter()
action_parameter.key = param.get('key')
action_parameter.value = param.get('value')
parameters.append(action_parameter)
msg.action.parameters = parameters
action_parameter.key = param.get("key") if param.get("key") else ""
action_parameter.value = param.get("value") if param.get("value") else ""
msg.action.parameters.append(action_parameter)
if publish_topic:
self._card_activity_pub.publish(msg)
return msg
Expand Down
2 changes: 1 addition & 1 deletion google_chat_ros/src/google_chat_ros/google_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _pubsub_cb(self, message):
except Exception as e:
rospy.logerr("Failed to handle the request from Cloud PubSub.")
rospy.logerr("It might be caused because of invalid type message from GCP")
rospy.logerr("{}".str(e))
rospy.logerr(e)
finally:
message.ack()

Expand Down
Loading