displayAvatarURL() returns an .webp image instead of a .gif

Viewed 318

my code:

const { SlashCommandBuilder } = require('@discordjs/builders');
const Discord = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('avatar')
        .setDescription('Get the avatar URL of the selected user.')
        .addUserOption(option => option.setName('user').setDescription('The user\'s avatar to show')),
    async execute(interaction) {
        const user = interaction.options.getUser('user');
        const embed = new Discord.MessageEmbed();

        embed.setTitle(`${user.username}'s avatar`);
        embed.setURL(user.avatarURL);
        embed.setColor('RANDOM');
        embed.setImage(user.displayAvatarURL() + "?size=1024");

        interaction.reply({ embeds: [embed] });
    }
};

basically i want it to display the original image/gif instead of the .webp file because for some reason it displays a .webp file

1 Answers
Related