I have tried to make a hug command on discord to hug the mentioned user. I set up a command to check if there has been a user mentioned. If I do not mention a user, it works as intended, but when mentioning a user, it outputs the same thing. Here is my code:
if (message.mentions.users.length > 1) {
const hug = new Discord.MessageEmbed()
.setAuthor(`${message.mentions.users.first().username} got a hug from ${message.author.username}!`, `${message.author.avatarURL({ dynamic:true })}`)
.setImage(hugs[hugged])
.setColor('#ffb9f4')
message.channel.send(hug);
} else {
message.channel.send('Please mention a user to hug!');
};
I don't think anything else should be needed but let me know
question from:https://stackoverflow.com/questions/65546358/else-code-not-working-properly-discord-js