ThreadBroadcastMessageEvent is missing `bot_id`
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- api
调研方向
该 issue 指向 packages/types/src/events/message.ts,具体是第 276–300 行附近的 ThreadBroadcastMessageEvent 定义。将该类型与 GenericMessageEvent 一起阅读,并检查是否有相关的类型测试。当广播事件上表示了 bot_id?: string,且类型接受访问 event.bot_id 时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Package
@slack/types
SDK Version
@slack/[email protected]
Node.js Version
N/A (type definition issue)
Operating System
No response
Steps to Reproduce
- Set up an app subscribed to the
message.channelsevent. - Start a thread as a user in a channel where the app is a member.
- As the bot, reply in that thread with
chat.postMessage({ channel, thread_ts, text, reply_broadcast: true }). - Inspect the payload of the
messageevent the app receives for that reply.
In TypeScript, the following code does not compile:
import type { ThreadBroadcastMessageEvent } from "@slack/types";
function isFromBot(event: ThreadBroadcastMessageEvent) {
return !!event.bot_id; // error TS2339: Property 'bot_id' does not exist on type 'ThreadBroadcastMessageEvent'
}
Expected Result
ThreadBroadcastMessageEvent defines bot_id?: string, like GenericMessageEvent does. Slack sends this field, so we can check whether the broadcast reply itself was posted by a bot without a type assertion.
Actual Result
Slack sends a message event with subtype: "thread_broadcast". The event includes a top-level bot_id:
{
"type": "message",
"subtype": "thread_broadcast",
"user": "U0XXXXXXX",
"bot_id": "B0XXXXXXX",
"app_id": "A0XXXXXXX",
"text": "broadcast test",
"ts": "1791786680.944589",
"thread_ts": "1791786656.190749",
"channel": "C0XXXXXXX",
"channel_type": "channel",
"event_ts": "1791786680.944589",
"root": { "user": "U0YYYYYYY", "ts": "1791786656.190749", "reply_count": 2, ... },
"blocks": [ ... ]
}
However, ThreadBroadcastMessageEvent does not define bot_id, even after #2763:
The only bot_id reachable from this type is root.bot_id, which describes the thread parent, not the broadcast reply. Code that uses root.bot_id to detect bot messages gets both cases wrong: a user's broadcast in a bot-started thread looks like a bot message, and a bot's broadcast in a user-started thread looks like a user message.
This is a follow-up to #2762, which covered other missing fields on the same type.
- 主要语言
- TypeScript
- 星标
- 3.4k
- 派生
- 691
- 平均合并
- 2 天 20 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slackapi/node-slack-sdk 的其他 Issue
-
Support assistant.search.* APIs可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭auto-triage-skip enhancement pkg:web-api
难度 2/5 1-3 小时 新手友好度 68/100
slackapi/node-slack-sdk#2607 · 2 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
`SlackListsItem FieldMessage.message` type does not match API response shape可能已有人在做 @AjTheSpidey 于 171 天前认领。 未关闭area:typescript auto-triage-skip bug pkg:web-api
难度 2/5 1-3 小时 新手友好度 82/100
slackapi/node-slack-sdk#2598 · 2 条评论 ·
维护者通常 1 天内回复
-
Missing TypeScript response type for files.uploadV2可能已有人在做 @dajiaohuang 于 38 天前认领。 未关闭area:typescript auto-triage-skip bug pkg:web-api
难度 2/5 1-3 小时 新手友好度 66/100
slackapi/node-slack-sdk#2459 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 75/100
slackapi/node-slack-sdk#2791 ·
维护者通常 1 天内回复
-
untriaged
难度 5/5 一周以上 新手友好度 15/100
slackapi/node-slack-sdk#2773 ·
维护者通常 1 天内回复
查看 slackapi/node-slack-sdk 的全部 Issue
相似的 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 66/100
microsoft/playwright#43875 · 1 条评论 ·
维护者通常 1 天内回复
-
feature
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1 小时以内 新手友好度 88/100
adobe/react-spectrum#10909 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
Run the dependency drift check可能已有人在做 @spaceninja 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 72/100
cloudfour/lighthouse-parade#449 ·
维护者通常 1 天内回复