utility.guildinfo: ignore 0 emotes/stickers

This commit is contained in:
Cynthia Foxwell 2023-11-15 14:11:33 -07:00
parent c2bf184cf4
commit 266bcaac42

View file

@ -1911,7 +1911,7 @@ guildinfo.callback = async function (msg, line) {
} integration`,
inline: true,
},
{
guild.emojis.length > 0 && {
name: `Emotes (${guild.emojis.length})`,
value: `${
guild.emojis.filter((e) => e.animated).length
@ -1922,7 +1922,7 @@ guildinfo.callback = async function (msg, line) {
} unavailable`,
inline: true,
},
{
guild.stickers.length > 0 && {
name: `Stickers (${guild.stickers.length})`,
value: `${
guild.stickers.filter((s) => s.format_type == 1).length
@ -2032,7 +2032,7 @@ guildinfo.callback = async function (msg, line) {
value: `<t:${Math.floor(snowflakeToTimestamp(guild.id) / 1000)}:R>`,
inline: true,
},
{
guild.emojis.length > 0 && {
name: `Emotes (${guild.emojis.length})`,
value: `${
guild.emojis.filter((e) => e.animated).length
@ -2043,7 +2043,7 @@ guildinfo.callback = async function (msg, line) {
} unavailable`,
inline: true,
},
{
guild.stickers.length > 0 && {
name: `Stickers (${guild.stickers.length})`,
value: `${
guild.stickers.filter((s) => s.format_type == 1).length
@ -2058,7 +2058,7 @@ guildinfo.callback = async function (msg, line) {
} unavailable`,
inline: true,
},
],
].filter((x) => !!x),
footer: {
text: "Fetched from guild preview",
},