diff --git a/plugins/picture-links/src/index.tsx b/plugins/picture-links/src/index.tsx index a873090..2845304 100644 --- a/plugins/picture-links/src/index.tsx +++ b/plugins/picture-links/src/index.tsx @@ -45,7 +45,11 @@ async function openModal(src: string, event) { } const unpatchAvatar = after("default", HeaderAvatar, ([{ user, style, guildId }], res) => { - const guildSpecific = user.guildMemberAvatars?.[guildId] && `https://cdn.discordapp.com/guilds/${guildId}/users/${user.id}/avatars/${user.guildMemberAvatars[guildId]}.png?size=4096`; + var ext = "png"; + if (typeof user.guildMemberAvatars?.[guildId] === "string") { + if (user.guildMemberAvatars?.[guildId].includes("a_")) { ext = "gif"; } + } + const guildSpecific = user.guildMemberAvatars?.[guildId] && `https://cdn.discordapp.com/guilds/${guildId}/users/${user.id}/avatars/${user.guildMemberAvatars[guildId]}.${ext}?size=4096`; const image = user?.getAvatarURL?.(false, 4096, true); if (!image) return res;