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

126
Visualizações
Discord await messages never collects any messages

For some reason, no matter what I try, the awaitMessages function never gets any messages from the channel. I've tried awaiting it, I've tried using different functions like collectors and yet nothing is picking up anything. Original commands are picked up fine but not when awaiting messages.

        const filter = m => m.author == interaction.author;

        interaction.reply('Recieved')
        .then(() =>
        interaction.channel.awaitMessages(filter, {
                max: 1,
                time: 3000,
                errors: ['time']
            })
            .then(collected => {
                interaction.channel.send(collected.first());
            })
            .catch(collected => {
                interaction.channel.send('Timeout');
            })
        );
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I've tracked down this issue! In case anyone else's having this problem as I think it could be common in discord.js v13.

The problem lies in intents. The intents that the Discord.js guide suggests are [Intents.FLAGS.GUILDS]; however, this does not allow for direct reading of messages. If you want to use awaitMessages or even add a listener to the message event that you need to include the "GUILD_MESSAGES" intent.

about 4 years ago · Juan Pablo Isaza Relatório

0

Interaction#author does not exist, and comparing objects can give unexpected results. Use Interaction#user and compare the IDs

const filter = m => m.author.id == interaction.user.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