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

64
Views
message.author.dmChannel.awaitMessages not working

I have a setup command where the setup takes place in DMs. Sending the first message works but whenever I dm the bot it doesn’t detect my messages. Code:

const filter = m => m.content;
message.author.dmChannel.awaitMessages(filter, {
  max: 1,
  time: 60000,
  errors: ["time"]
}).then(collected => {
  collected.reply("message collected message");
}.catch(() => message.author.send("ran out of time message")

When the time runs out it dms me the ran out of time message

I also tried this but it also didn’t work

const filter = m => m.content;
message.author.dmChannel.awaitMessages({
  filter,
  max: 1,
  time: 60000,
  errors: ["time"]
}).then(collected => {
  collected.reply("message collected message");
}.catch(() => message.author.send("ran out of time message")
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

TextChannel.awaitMessages() now only takes 1 argument. This includes the filter property in the object. Changing it to this will work:

const filter = m => m.content;
message.author.dmChannel.awaitMessages({
  filter,
  max: 1,
  time: 60000,
  errors: ["time"]
})
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!