Repository navigation
Add file_ids to ChatUpdateMessageParams - #475
Conversation
chat.update accepts file_ids to attach already-uploaded files to an existing message. Files uploaded via files.completeUploadExternal with no channel_id stay private and post no message, so this lets callers attach a file to a bot response in place instead of posting a separate file message. Empty lists are omitted, so existing callers are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| * IDs of already-uploaded files to attach to the message. Upload them without a channel | ||
| * (files.completeUploadExternal with no channel_id) so Slack doesn't post a separate file | ||
| * message. Slack replaces the message's blocks on update, so re-send the existing blocks too. | ||
| */ |
There was a problem hiding this comment.
Nit: check() still requires text/attachments/blocks even when only file_ids is set, but Slack doesn’t require that for file_ids alone. Probably fine in practice since callers already have to re-send blocks (per the javadoc above), just flagging in case a file_ids-only update is a valid use case you want to support.
There was a problem hiding this comment.
Good flag. I left it as is on purpose. When I tested chat.update with just text + file_ids, Slack replaced the message's blocks with a plain rich_text block (buttons and context gone), so a files-only update would wipe the rest of the message. Keeping the check nudges callers to re-send blocks, which the Javadoc says is required. I haven't tried a file_ids-only update with no text, but it isn't a use case we need. Happy to relax it if you think it's worth supporting.
Matches newer params (StreamParams.getChunks, ChatStopStreamParams). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Adds
file_idstoChatUpdateMessageParams, matching thechat.updateargument ("Array of new file ids that will be sent with this message").Why
To attach a file to an existing bot message instead of posting it as a separate message:
files.getUploadURLExternal+files.completeUploadExternalwithoutchannel_id. The file stays private and no message is posted.chat.updatethe target message withfile_ids.Verified against the Slack API: the file renders inside the updated message with its inline preview, and other channel members can open it. Note that Slack replaces the message's blocks on update, so callers must re-send the existing blocks along with
file_ids(sending only text +file_idsdrops them). This is documented on the getter.Compatibility
chat.updateis JSON-encoded, so the list serializes as a JSON array. The class uses@JsonInclude(NON_EMPTY), so an empty list is omitted and existing callers send the same payload as before.Tests
ChatUpdateMessageParamsSerializationTestcovers the array serialization and the omitted-when-empty case.MessageParamsTeststill passes.🤖 Generated with Claude Code