Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

ThreadBroadcastMessageEvent is missing `bot_id`

Abierto Apto para principiantes
#2,766 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@sean0407 ya está trabajando en esto.

Desde el 13/10/2026.

  • #2769 de @sean0407 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
api

Línea de trabajo

El issue apunta a packages/types/src/events/message.ts, concretamente a la definición de ThreadBroadcastMessageEvent alrededor de las líneas 276–300. Lee ese tipo junto con GenericMessageEvent y comprueba si hay pruebas de tipos relacionadas. El trabajo estará terminado cuando bot_id?: string esté representado en el evento de difusión y los tipos acepten el acceso a event.bot_id.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 as a user in a channel where the app is a member.
  3. As the bot, reply in that thread with chat.postMessage({ channel, thread_ts, text, reply_broadcast: true }).
  4. Inspect the payload of the message event 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:

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

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.

Lenguaje dominante
TypeScript
Estrellas
3.4k
Forks
688
Merge medio
1 d 49 min
PR fusionados (30 d)
15

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de slackapi/node-slack-sdk

Todos los issues de slackapi/node-slack-sdk

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.