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

149
Views
how to make a bot Private message on command?

Wanted to make the bot dm a person who uses the command to get a hint based on the puzzle role they had.

did watch a YT vid that showed to dm a person based on a trigger. That didn't help as it needs too many triggers.

the bot should dm a person on what role they have so I do know we need to use if (message.member.roles.cache.some(role => role.name === 'Puzzle 1')

Not completely sure on how to make it :'(

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

0

You can use message.author.send("YOUR MESSAGE HERE") for sending a private message to the user.

If you want to check user role by name before sending DM, you can make something like that:

if (message.member.roles.cache.some(role => role.name === 'Puzzle 1')){
  message.author.send("YOUR MESSAGE HERE")
}

IMPORTANT NOTE: If a user disabled Allow direct messages from server members on privacy & safety settings, the bot can't send a message to a user. So I recommend you to use try/catch.

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!