How to show the user avatar if the user has a gif

Viewed 656

Every time i run this command:

        const profile = new Discord.MessageEmbed()
        .setTitle('** **')
        .addField(' ', message.author.username)
        .addField(' ', version)
        .addField(' ', message.guild.name)
        .setColor(0xB68AFF)
        .setThumbnail(message.author.displayAvatarURL())
        .setFooter('Made by 11 | discord.gg/PPNyDyw');
        message.channel.send(profile);
        break;

It posts the user's avatar, but if they have a gif it posts a still image.

How do I fix this issue?

1 Answers

You need to set it as an option (ImageURLOptions documentation).

Search for the dynamic parameter there. Your code would need to be this way :

message.author.displayAvatarURL({ dynamic : true })
Related