Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#2,762 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api

Hướng nghiên cứu

Giao diện là ThreadBroadcastMessageEvent trong packages/types/src/events/message.ts, khoảng dòng 276-296. Sao chép các trường tùy chọn files, upload, display_as_bot và parent_user_id từ FileShareMessageEvent và GenericMessageEvent trong cùng tệp, giữ nguyên kiểu dữ liệu của chúng. Hoàn thành khi giao diện khai báo đủ bốn trường và ví dụ event.files trong issue vượt qua kiểm tra kiểu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
3.4k
Fork
688
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của slackapi/node-slack-sdk

Tất cả issue của slackapi/node-slack-sdk

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.