Skip to content

Commit

Permalink
Fix #1342 files_upload_v2 fails to share files in a channel (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch authored Mar 7, 2023
1 parent 66e8359 commit 9aaea27
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions integration_tests/samples/basic_usage/uploading_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
channels = ",".join(["#random"])
filepath = "./tmp.txt"
response = client.files_upload(channels=channels, file=filepath)
response = client.files_upload_v2(channel=response.get("file").get("channels")[0], file=filepath)
3 changes: 2 additions & 1 deletion slack_sdk/web/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3152,9 +3152,10 @@ async def files_upload_v2(
channel_to_share = channels[0]
completion = await self.files_completeUploadExternal(
files=[{"id": f["file_id"], "title": f["title"]} for f in files],
channel=channel_to_share,
channel_id=channel_to_share,
initial_comment=initial_comment,
thread_ts=thread_ts,
token=kwargs.get("token"),
**kwargs,
)
if request_file_info is True:
Expand Down
3 changes: 2 additions & 1 deletion slack_sdk/web/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3143,9 +3143,10 @@ def files_upload_v2(
channel_to_share = channels[0]
completion = self.files_completeUploadExternal(
files=[{"id": f["file_id"], "title": f["title"]} for f in files],
channel=channel_to_share,
channel_id=channel_to_share,
initial_comment=initial_comment,
thread_ts=thread_ts,
token=kwargs.get("token"),
**kwargs,
)
if request_file_info is True:
Expand Down
3 changes: 2 additions & 1 deletion slack_sdk/web/legacy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3154,9 +3154,10 @@ def files_upload_v2(
channel_to_share = channels[0]
completion = self.files_completeUploadExternal(
files=[{"id": f["file_id"], "title": f["title"]} for f in files],
channel=channel_to_share,
channel_id=channel_to_share,
initial_comment=initial_comment,
thread_ts=thread_ts,
token=kwargs.get("token"),
**kwargs,
)
if request_file_info is True:
Expand Down

0 comments on commit 9aaea27

Please sign in to comment.