utility.avatar: guild avatar support try 2
This commit is contained in:
parent
7e6b71c802
commit
336a9abedd
1 changed files with 23 additions and 6 deletions
|
@ -112,9 +112,18 @@ avatar.callback = async function (msg, line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const avatar = member.avatar || member.user.avatar;
|
const avatar = member.avatar || member.user.avatar;
|
||||||
const url = `${AVATAR_BASE}${member.id}/${avatar}.${
|
const url =
|
||||||
avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
msg.channel.guild && member.avatar
|
||||||
}`;
|
? `https://cdn.discordapp.com/guilds/${msg.channel.guild.id}/users/${
|
||||||
|
member.id
|
||||||
|
}/avatars/${member.avatar}.${
|
||||||
|
member.avatar.startsWith("a_")
|
||||||
|
? "gif?size=1024&_=.gif"
|
||||||
|
: "png?size=1024"
|
||||||
|
}`
|
||||||
|
: `${AVATAR_BASE}${member.id}/${avatar}.${
|
||||||
|
avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
||||||
|
}`;
|
||||||
return {
|
return {
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
|
@ -129,9 +138,17 @@ avatar.callback = async function (msg, line) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const avatar = msg.member.avatar || msg.author.avatar;
|
const avatar = msg.member.avatar || msg.author.avatar;
|
||||||
const url = `${AVATAR_BASE}${msg.author.id}/${avatar}.${
|
const url = msg.member.avatar
|
||||||
avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
? `https://cdn.discordapp.com/guilds/${msg.channel.guild.id}/users/${
|
||||||
}`;
|
msg.member.id
|
||||||
|
}/avatars/${msg.member.avatar}.${
|
||||||
|
msg.member.avatar.startsWith("a_")
|
||||||
|
? "gif?size=1024&_=.gif"
|
||||||
|
: "png?size=1024"
|
||||||
|
}`
|
||||||
|
: `${AVATAR_BASE}${msg.author.id}/${avatar}.${
|
||||||
|
avatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
||||||
|
}`;
|
||||||
return {
|
return {
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue