This pull request's diff hasn't been prepared yet. Log in with GitHub to have us prepare it for review.

fix(types): add missing file fields to ThreadBroadcastMessageEvent #2763

Merged
srtaalej opened 1:25pm on October 9, 2026 wanted to merge 19 Ξ” into slackapi/node-slack-sdk main from
fix/thread-broadcast-missing-fields

Package

@slack/types

SDK Version

@slack/[email protected]

Node.js Version

N/A (type definition issue)

Operating System

No response

Steps to Reproduce

  1. Set up an app subscribed to the message.channels event.
  2. Start a thread in a channel where the app is a member.
  3. Reply in that thread. Attach a file and check "Also send to #channel".
  4. Inspect the payload of the message event the app receives.

In TypeScript, the following code does not compile:

import type { ThreadBroadcastMessageEvent } from "@slack/types";

function handle(event: ThreadBroadcastMessageEvent) {
  event.files; // error TS2339: Property 'files' does not exist on type 'ThreadBroadcastMessageEvent'
}

Expected Result

ThreadBroadcastMessageEvent defines files?: File[], upload?: boolean, display_as_bot?: boolean and parent_user_id?: string. Slack sends these fields, so we can access them without a type assertion.

Actual Result

Slack sends a message event with subtype: "thread_broadcast". The event includes files, upload, display_as_bot and parent_user_id:

{
  "type": "message",
  "subtype": "thread_broadcast",
  "user": "U0XXXXXXX",
  "text": "broadcast with a file",
  "ts": "1791448977.697319",
  "thread_ts": "1791447929.601119",
  "channel": "C0XXXXXXX",
  "channel_type": "channel",
  "event_ts": "1791448977.697319",
  "client_msg_id": "...",
  "parent_user_id": "U0XXXXXXX",
  "display_as_bot": false,
  "upload": false,
  "files": [{ "id": "F0XXXXXXX", "name": "image.png", "filetype": "png", ... }],
  "root": { ... },
  "blocks": [ ... ]
}

However, ThreadBroadcastMessageEvent does not define any of these four fields:

https://github.com/slackapi/node-slack-sdk/blob/b3190fd05b11c19e33a8c742ebff15369aa9a00d/packages/types/src/events/message.ts#L276-L296

In the same file, GenericMessageEvent defines files and parent_user_id, and FileShareMessageEvent defines all four.

srtaalej authored
of work during October 9
Diff Delta:
19
About 19 Diff Delta/hour
Classified as:  Bug Fix, Feature Add

srtaalej's Description of Work #2762 ThreadBroadcastMessageEvent is missing `files`, `upload`, `display_as_bot` and `parent_user_id`

Summary

Fixes #2762.

ThreadBroadcastMessageEvent was missing fields that Slack sends when a thread reply with an attached file is also sent to the channel. This adds them as optional fields, matching FileShareMessageEvent:


  • files?: File[]

  • upload?: boolean

  • display_as_bot?: boolean

  • parent_user_id?: string

I reproduced this with a Bolt app subscribed to message.channels:



  • Broadcast with a file: all four fields are present in the payload.


  • Text-only broadcast: none of the four fields are present, including parent_user_id. That's why every field is optional.

x_files (present on FileShareMessageEvent) was not sent in either case, so it isn't added here.

This also adds a tsd test in packages/types/test/events/message.test-d.ts and a patch changeset for @slack/types.

Requirements <!-- Place an x in each [ ] -->

Building updated commit group diff...
3 total changed files
Loading changes...
Loading changes...