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

203
Vistas
How to mention a user in a command

I don't know how to make a command to interact with a user by mentioning with this command structure

I know it is not possible as the command is currently

const Discord = require("discord.js");

const Discord = require("discord.js");

module.exports = new Command({
    name: "avatar",
    permission: "SEND_MESSAGES",
    async run(message) {
        const user = message.mentions.users.first() || message.author;
        const avatarEmbed = new Discord.MessageEmbed();

        user
        avatarEmbed
            .setColor("FF0000")
            .setAuthor(message.author.username)
            .setImage(message.author.avatarURL({ dynamic: true }))


        message.channel.send({embeds: [avatarEmbed]});

    }
});

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

try this


const Discord = require("discord.js");

const Discord = require("discord.js");

module.exports = new Command({
    name: "avatar",
    permission: "SEND_MESSAGES",
    async run(message) {
        const user = message.mentions.users.first() || message.author;
        const avatarEmbed = new Discord.MessageEmbed();

        avatarEmbed
            .setColor("FF0000")
            .setAuthor(message.author.username)
            .setImage(message.author.avatarURL({ dynamic: true }))


        message.channel.send({ content: `<@${user.id}>`, embeds: [avatarEmbed]});

    }
});
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can just pass the object directly and discord.js will manage it. Or you can go with the raw method

`<@{user.id}>`
`<@!{user.id}>`

or

`${user}` // discord.js will do the rest

But, either way, it will work

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