-
Notifications
You must be signed in to change notification settings - Fork 1
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
Convert slack upload file to new api #21
Convert slack upload file to new api #21
Conversation
Old approach is deprecated. Modified attacing, now without any visible urls.
files_upload_v2 is available since 3.19.5
Task linked: AY-6742 Convert Slack uploadFile to new api |
It should be |
with open(published_file, "rb") as f: | ||
uploaded_file = self.client.files_upload_v2( | ||
filename=os.path.basename(published_file), | ||
file=f.read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be just?
file=f.read() | |
file=f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sends the images right now, could try it without .read()
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works even without read
, I removed it and committed.
Changelog Description
Existing
files_upload
was made obsolete and replaced byfiles_upload_v2
.This PR provides that change.
New method supports better uploads and allows to attach uploaded images without any visible urls in the Slack message as it was before
Additional info
Bumped
slack-sdk
to 3.19.5 and higher.Testing notes:
test_integration
channel!!)test_integration
- it should upload and show images without visible urls