Skip to content

Commit

Permalink
save google chat image in /chat_notification with timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Nov 30, 2022
1 parent 5bf63e9 commit df97cc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion google_chat_ros/scripts/google_chat_ros_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self):
self.download_data = rospy.get_param('~download_data', True)
self.download_directory = rospy.get_param('~download_directory', "/tmp")
self.download_avatar = rospy.get_param('~download_avatar', False)
self.upload_parents_path = rospy.get_param(
'~upload_parents_path', 'chat_notification')

# For sending message
self._client = GoogleChatRESTClient(google_credentials)
Expand Down Expand Up @@ -411,7 +413,11 @@ def _upload_file(self, filepath, return_id=False):
return
# upload
try:
res = gdrive_upload(file_path=filepath)
res = gdrive_upload(
file_path=filepath,
parents_path=self.upload_parents_path,
use_timestamp_folder=True,
)
except rospy.ServiceException as e:
rospy.logerr("Failed to call Google Drive upload service, status:{}".format(str(e)))
else:
Expand Down

0 comments on commit df97cc0

Please sign in to comment.