discord.jsavatar

Avatar command resolution


Basically Im trying to create a Avatar command, but its show me the avatar but the image resolution are bad. so how do I fix it?

Here's my code


module.exports = {
  name: "avatar",
  aliases: ["icon", "pfp"],
  category: "Fun",
  description: "Return A User Avatar!",
  usage: "Avatar | <Mention Or ID>",
  run: async (client, message, args) => {
    
    const Member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member;

    const Embed = new Discord.MessageEmbed()
    .setDescription(message.author.tag + " 's Avatar")
    .setColor("#800000")
    .setImage(Member.user.displayAvatarURL({size: 1024, dynamic: true}))
    .setFooter(`Requested By ${message.author.username}`)
    .setTimestamp();

    return message.channel.send(Embed);
  }
};

  module.exports.config = {
    name: 'avatar',
    description: 'do a avatar',
    usage: 'avatar',
    botPerms: [],
    userPerms: [],
    aliases: ['av'],
};

Solution

  • .setImage(Member.user.displayAvatarURL({size: 1024, dynamic: true}))
    

    Try 256 or 512 instead. It actually depends on the user's avatar itself.

    ImageURLOptions

    MessageEmbedImage