`message_replied` event missing text property in typescript

未关闭
#2,025 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
api

调研方向

从 MessageRepliedEvent 接口的 TypeScript 定义开始,跟踪示例所使用的 message_replied 处理器类型。确认事件文档中的 text 属性已得到表示,然后验证 message.message.text 可以通过类型检查而不会出现报告的错误。

由索引模型根据 Issue 内容生成。

描述

area:typescript bug pkg:types semver:major
Description

The text property does not exist on MessageRepliedEvent interface in typescript

What type of issue is this? (place an x in one of the [ ])
  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion
Requirements (place an x in each of the [ ])
  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version: 3.12.1

node version: 16.3.2

OS version(s): MacOS 12.4

Steps to reproduce:
slackApp.message(subtype("message_replied"), async ({ message }) => {
  if (message.subtype === "message_replied") {
    const messageThreadId = message.message.thread_ts;

    // Find the socket for the given thread ID
    for (const connection in openConnections) {
      const connectionProps = openConnections[connection];
      if (connectionProps.thread === messageThreadId) {
        connectionProps.socket.send(message.message.text); <---
      }
    }
  }
})
Expected result:

message.message.text is type string per event documentation:

https://api.slack.com/events/message/message_replied

Actual result:
Property 'text' does not exist on type 'MessageEvent & { thread_ts: string; reply_count: number; replies: MessageEvent[]; }'.
  Property 'text' does not exist on type 'MessageChangedEvent & { thread_ts: string; reply_count: number; replies: MessageEvent[]; }'
Attachments:

Screen Shot 2022-09-01 at 5 27 23 PM

主要语言
TypeScript
星标
3.4k
派生
693
平均合并
1 天 10 小时
30 天内合并 PR
75

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

slackapi/node-slack-sdk 的其他 Issue

查看 slackapi/node-slack-sdk 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。