Using Typescript, filesUploadV2 requires deprecated 'channels' argument when 'thread_ts' is given #1846
Closed
1 of 7 tasks
Labels
area:typescript
issues that specifically impact using the package from typescript projects
bug
M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
pkg:web-api
applies to `@slack/web-api`
semver:patch
Milestone
Packages:
Select all that apply:
@slack/web-api
@slack/rtm-api
@slack/webhooks
@slack/oauth
@slack/socket-mode
@slack/types
Reproducible in:
The Slack SDK version
"slack/web-api": "^7.3.1",
Node.js runtime version
v21.6.2
Typescript version
"typescript": "5.4.5",
Steps to reproduce:
With the following code:
I get the following Typescript compile error:
Property 'channels' is missing in type '{ channel_id: string; thread_ts: string; content: string; filename: string; title: string; }' but required in type 'FileThreadDestinationArgumentChannels'.
However, if I include the
channels
field, I get a warning at runtime:[WARN] web-api:WebClient:0 Although the 'channels' parameter is still supported for smoother migration from legacy files.upload, we recommend using the new channel_id parameter with a single str value instead (e.g. 'C12345').
If the
thread_ts
argument is not included, thenchannels
is not required.The text was updated successfully, but these errors were encountered: