Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!