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

125
Views
How do I make the bot dm me with a command

So I have an easter egg command. If someone says +founder, my bot replies that the user found an easter egg. But I want the bot to dm me if anyone runs the command.

Here's my code :

module.exports = {
    name: 'founder',
    description: "easter egg",
    execute(message, args){
        message.channel.send('You found a easter egg!! Don\'t tell anyone else.....');
    }
}

And here's what in main.js

if (command === 'founder') {
    client.commands.get('founder').execute(message, args);
} 
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You'll need to grab yourself as a User/GuildMember and use send to send a message:

module.exports = {
    name: 'founder',
    description: 'easter egg',
    async execute(message, args) {
        message.channel.send('You found an easter egg!! Don\'t tell anyone else.....');
        const me = await message.guild.members.fetch('YOUR ID HERE');
        me.send(`${message.author} found an easter egg!`);
    }
}
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!