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

86
Visualizações
discord.js - MessageCollector won't end

The collector won't end, even if there is time set to 1.

const filter = msg => msg.author.id === message.author.id;

const collector = new MessageCollector(message.channel, filter, {
    max: 3,
    time: 5000,
})

collector.on('collect', collector => {
    console.log(`${collector.content}`)
})

collector.on('end', collected => {
    console.log(`${collected.size}`)
})
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The constructor takes arguments (channel, options) and not (channel, filter, options). filter should be part of the options object. See docs.

Right now you are passing the filter function instead of an options object, followed by what should be an options object but is actually just an ignored superfluous third argument.

This is the correct way:

const collector = new MessageCollector(message.channel, {
    filter,
    max: 3,
    time: 5000
})
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