Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ThreadBroadcastMessageEvent is missing `files`, `upload`, `display_as_bot` and `parent_user_id`

クローズ 初心者向け
#2,762 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api

調査の方向性

対象のインターフェースは packages/types/src/events/message.ts 内の ThreadBroadcastMessageEvent で、276〜296行目付近にあります。同じファイル内の FileShareMessageEvent と GenericMessageEvent から、任意フィールドの files、upload、display_as_bot、parent_user_id をコピーし、型はそのまま維持してください。インターフェースに4つのフィールドがすべて宣言され、issue の event.files の例が型チェックを通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

untriaged
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.

主要言語
TypeScript
スター
3.4k
フォーク
691
平均マージ
1日 2時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

slackapi/node-slack-sdk のほかの issue

slackapi/node-slack-sdk の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。