Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display available emojis separately from total on server info #433

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion backend/src/plugins/Utility/functions/getServerInfoEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
export async function getServerInfoEmbed(
pluginData: GuildPluginData<UtilityPluginType>,
serverId: string,
requestMemberId?: string,

Check warning on line 28 in backend/src/plugins/Utility/functions/getServerInfoEmbed.ts

View workflow job for this annotation

GitHub Actions / build (18.16)

'requestMemberId' is defined but never used
): Promise<APIEmbed | null> {
const thisServer = serverId === pluginData.guild.id ? pluginData.guild : null;
const [restGuild, guildPreview] = await Promise.all([
Expand Down Expand Up @@ -205,9 +205,14 @@
[GuildPremiumTier.Tier3]: 60,
}[restGuild.premiumTier] ?? 0;

const availableEmojis = restGuild.emojis.cache.filter((e) => e.available);
otherStats.push(
`Emojis: **${restGuild.emojis.cache.size}** / ${maxEmojis * 2}${
`Emojis: **${availableEmojis.size}** / ${maxEmojis * 2}${
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}`);
Expand Down
Loading