diff --git a/google_chat_ros/scripts/google_chat_ros_node.py b/google_chat_ros/scripts/google_chat_ros_node.py index a66d1ba7b..43031e417 100644 --- a/google_chat_ros/scripts/google_chat_ros_node.py +++ b/google_chat_ros/scripts/google_chat_ros_node.py @@ -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 diff --git a/google_chat_ros/src/google_chat_ros/google_chat.py b/google_chat_ros/src/google_chat_ros/google_chat.py index f704bf67d..c95b78a8e 100644 --- a/google_chat_ros/src/google_chat_ros/google_chat.py +++ b/google_chat_ros/src/google_chat_ros/google_chat.py @@ -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()