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

195
Views
Discord.js awaitMessages returns nothing and blocks the code

Here is my code:

try {
    var collectedMessages = await msg.author.dmChannel.awaitMessages(true, { time: 30000, max: 1, errors: ['time'] });
} catch (e) {
    msg.author.send("Looks like you took too long to reply!");
};

And it doesn't react to messages and doesn't timeout. I'm on v13.3.1

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The arguments are invalid. In v13, only the options argument is present. Change it to this:

await msg.author.dmChannel.awaitMessages({ 
    time: 30000,
    max: 1,
    errors: ['time'],
    filter: () => true // I wouldn't recommend this but it's what you want
})
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!