I'm making a bot in discord.js using the Visual Studio Code app. I'm trying to create a command for profile pictures so when you type -pfp it would show you your profile picture and when you type -pfp @user it would show the person's you mentioned profile picture. (- is the prefix). Though the bot only sends the message without the embed part with the picture. When I mention someone else it does the same thing but mentioning me and not the user.
This is what I have:
if (!message.content.startsWith(prefix) || message.author.bot) return;
if (message.content.startsWith(prefix + 'pfp')) {
message.channel.send('Here is <@'+ message.author.id+ ">'s pfp :)")
const avatarEmbed = new Discord.MessageEmbed()
.setColor('#446580')
.setAuthor('user.username')
.setImage(message.author.displayAvatarURL());
} else if (message.content.startsWith(prefix+ 'pfp'+ message.mentions.users)) {
message.channel.send('Here is <@'+ message.user.id+ ">'s pfp :)")
const avatarEmbed = new Discord.MessageEmbed()
.setColor('#446580')
.setAuthor('user.username')
.setImage(message.user.displayAvatarURL());
}
});