Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda