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

171
Visualizações
Get the message id of a message a bot sent in response

I don't have any code to share as I am just stumped. I know how to get the message id of the message a user sent; for example, if I did !test, I could do message.id to get that id.

But I want to get the id of the message a bot replied with, so if I did !test and a bot replied with "working", I want to get the id of that "working" message. Any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can wait for the message to be sent and grab its ID. send() returns the message, so the following will work:

client.on('messageCreate', async (message) => {
  if (message.author.bot) return;
  let sentMessage = await message.channel.send('It works');
  console.log(sentMessage.id);
});
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