utility.avatar: add checks

This commit is contained in:
Cynthia Foxwell 2022-04-03 10:42:05 -06:00
parent 2dbe433b1d
commit d7162a0694

View file

@ -127,6 +127,7 @@ avatar.callback = async function (msg, line) {
? "gif?size=1024&_=.gif" ? "gif?size=1024&_=.gif"
: "png?size=1024"); : "png?size=1024");
const guildUrl = const guildUrl =
guildAvatar &&
"https://cdn.discordapp.com/guilds/" + "https://cdn.discordapp.com/guilds/" +
guild.id + guild.id +
"/users/" + "/users/" +
@ -170,6 +171,7 @@ avatar.callback = async function (msg, line) {
? "gif?size=1024&_=.gif" ? "gif?size=1024&_=.gif"
: "png?size=1024"); : "png?size=1024");
const guildUrl = const guildUrl =
guildAvatar &&
"https://cdn.discordapp.com/guilds/" + "https://cdn.discordapp.com/guilds/" +
guild.id + guild.id +
"/users/" + "/users/" +
@ -177,7 +179,9 @@ avatar.callback = async function (msg, line) {
"/avatars/" + "/avatars/" +
guildAvatar + guildAvatar +
"." + "." +
(guildAvatar.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"); (guildAvatar.startsWith("a_")
? "gif?size=1024&_=.gif"
: "png?size=1024");
baseEmbed.description = baseEmbed.description =
`[Normal avatar](${normalUrl})` + `[Normal avatar](${normalUrl})` +