3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Display available emojis separately from total on server info (#433)

* respect .available (almeida-approved code!!)

Signed-off-by: GitHub <noreply@github.com>

* Update backend/src/plugins/Utility/functions/getServerInfoEmbed.ts

Co-authored-by: Almeida <almeidx@pm.me>

---------

Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
Tiago R 2023-12-27 18:20:48 +00:00 committed by GitHub
parent fdefca17ae
commit 94a712832a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,9 +205,14 @@ export async function getServerInfoEmbed(
[GuildPremiumTier.Tier3]: 60, [GuildPremiumTier.Tier3]: 60,
}[restGuild.premiumTier] ?? 0; }[restGuild.premiumTier] ?? 0;
const availableEmojis = restGuild.emojis.cache.filter((e) => e.available);
otherStats.push( otherStats.push(
`Emojis: **${restGuild.emojis.cache.size}** / ${maxEmojis * 2}${ `Emojis: **${availableEmojis.size}** / ${maxEmojis * 2}${
roleLockedEmojis ? ` (__${roleLockedEmojis} role-locked__)` : "" roleLockedEmojis ? ` (__${roleLockedEmojis} role-locked__)` : ""
}${
availableEmojis.size < restGuild.emojis.cache.size
? ` (__+${restGuild.emojis.cache.size - availableEmojis.size} unavailable__)`
: ""
}`, }`,
); );
otherStats.push(`Stickers: **${restGuild.stickers.cache.size}** / ${maxStickers}`); otherStats.push(`Stickers: **${restGuild.stickers.cache.size}** / ${maxStickers}`);