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]});
}
});
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]});
}
});
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