Is there a way to check if server banner is just an static picture or animated?

For example in the command Avatar this works automatically by just doing this
//In embed of course
.setImage(member.displayAvatarURL({format: 'png', size: 4096, dynamic: true}))
//In embed of course
.setImage(member.displayAvatarURL({format: 'png', size: 4096, dynamic: true}))
when the pinged user has an animated pfp the command just returns his avatar in gif format, otherwise just returns his pfp in png format. But when I try to do the same thing with server banner just returns the format that I specified, like
.setImage(guild.bannerURL({format: 'png', size: 4096, dynamic: true})) //this returns a png even if is animated
//Just in case, yes, "guild" is defined
.setImage(guild.bannerURL({format: 'png', size: 4096, dynamic: true})) //this returns a png even if is animated
//Just in case, yes, "guild" is defined
this returns a png, even if the server banner is animated. So, I wanted to ask if there's a way to check if the banner is animated or Static, so I can put an If that says something like "if animated then gif otherwise png" I truly don't wanna use the webp format puaj
4 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
KAVI
KAVI2y ago
1. Why don't you wanna use .webp ? <:E_think:793918036787986453>
TRKako
TRKakoOP2y ago
because when the file is compressed in webp the image becomes smaller than it would be as a gif/png and I personally feel that it loses quality <:8_:1002860605918683216> but I can get animated server banners with v13, the issue is that I need to write something like .setImage(guild.bannerURL({format: 'gif', size: 4096, dynamic: true})) cuandoMeEnteroQueLosAmiguitosDeM
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server