3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-22 01:05:02 +00:00

use User#displayAvatarURL and dont encode reason

This commit is contained in:
almeidx 2021-07-28 23:40:20 +01:00
parent d8dee5a8ad
commit 5523267678
9 changed files with 9 additions and 12 deletions

View file

@ -16,7 +16,7 @@ export const AvatarCmd = utilityCmd({
async run({ message: msg, args, pluginData }) {
const user = args.user || msg.author;
if (!(user instanceof UnknownUser)) {
const avatar = user.avatarURL() || user.defaultAvatarURL;
const avatar = user.displayAvatarURL();
let extension = avatar.slice(avatar.lastIndexOf("."), avatar.lastIndexOf("?"));
// Some pngs can have the .jpg extention for some reason, so we always use .png for static images
extension = extension === ".gif" ? extension : ".png";