utility.avatar: fixes for guild avatars

This commit is contained in:
Cynthia Foxwell 2021-08-29 20:02:12 -06:00
parent 159870877b
commit 4dadf820af

View file

@ -98,8 +98,9 @@ avatar.callback = async function (msg, line) {
) { ) {
return user; return user;
} else { } else {
const url = `${AVATAR_BASE}${user.id}/${user.avatar}.${ const avatar = user.avatar || user.user.avatar;
user.avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024" const url = `${AVATAR_BASE}${user.id}/${avatar}.${
avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
}`; }`;
return { return {
embed: { embed: {
@ -112,10 +113,9 @@ avatar.callback = async function (msg, line) {
}; };
} }
} else { } else {
const url = `${AVATAR_BASE}${msg.author.id}/${msg.author.avatar}.${ const avatar = msg.member.avatar || msg.author.avatar;
msg.author.avatar.startsWith("a_") const url = `${AVATAR_BASE}${msg.author.id}/${avatar}.${
? "gif?size=1024&_=.gif" avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
: "png?size=1024"
}`; }`;
return { return {
embed: { embed: {