Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
How to make my Slack Bot reply as a thread?

I have a bot that's meant to reply to messages in a channel with certain keywords it's listening for. I have it deployed and it's working perfectly, but it replies in the channel rather than starting a thread to a user's message. Here's my code that's meant to start the thread:

app.message("ake up", async ({ command, say }) => {
  try {
    say({ text: "I'm awake! ⭐️ Do you need assistance?", thread_ts: message.ts });
  } catch (error) {
      console.log("err")
    console.error(error);
  }
});

Nothing happens when I send a message saying "wake up". When it's the same without thread_ts: message.ts and just says say("I'm awake! ⭐️ Do you need assistance?")}, it works perfectly. and responds with that.

Here's the beginning of my code for reference:

require("dotenv").config();
const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  socketMode:true,
  appToken: process.env.APP_TOKEN
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This was answered on GitHub.

The trick here is that thread_ts is available only for threaded messages (it identifies the parent message which started the thread). If you want to start a thread, you can use ts value of the incoming message:

app.message("ake up", async ({ message, say }) => {
  try {
      await say({ text: "I'm awake! ⭐️ Do you need assistance?" , thread_ts: message.thread_ts || message.ts});
  } catch (error) {
      console.log("err")
      console.error(error);
  }
});

See also Spotting threads guide in Slack docs.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda