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

139
Visualizações
how to use the message parameter outside of the `messageCreate`

I am having trouble getting the definition of the message parameter outside of the client.on('messageCreate', async message) event. Because I use discord-music-player it has its own events which are outside of the messageCreate event and the bot now cant send the message when I trigger a discord-music-player event.
So, how do I pass the message event into a discord-music-player event?

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

0

Perhaps you want to use a global variable. Declaring a variable outside the event will save the value.

var lastMessage = null
client.on("messageCreate", async message => {
  lastMessage = message
  //rest of your callback
})
//once a message is received, lastMessage will be the message object, updating on each message
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