utility.linvite: sort features

This commit is contained in:
Cynthia Foxwell 2023-09-14 23:22:27 -06:00
parent fdd712a237
commit 5117f101e8

View file

@ -49,13 +49,6 @@ const CUSTOM_EMOTE_REGEX = /<(?:\u200b|&)?(a)?:(\w+):(\d+)>/;
const NOWPLAYING_BAR_LENGTH = 30; const NOWPLAYING_BAR_LENGTH = 30;
const STATUS_ICONS = {
online: "<:online:493173082421461002>",
idle: "<:idle:493173082006093836>",
dnd: "<:dnd:493173082261815307>",
offline: "<:offline:493173082253426688>",
};
const PRESENCE_ICONS = { const PRESENCE_ICONS = {
desktop: { desktop: {
online: "<:desktop_online:1028887024670871552>", online: "<:desktop_online:1028887024670871552>",
@ -551,7 +544,7 @@ lookupinvite.callback = async function (msg, line) {
} }
: null; : null;
const features = invite.guild.features.map( const features = invite.guild.features.sort().map(
(feature) => (feature) =>
(GUILD_FEATURES[feature]?.icon ?? "\u2753") + (GUILD_FEATURES[feature]?.icon ?? "\u2753") +
" " + " " +
@ -583,7 +576,7 @@ lookupinvite.callback = async function (msg, line) {
expires, expires,
{ {
name: "Member Count", name: "Member Count",
value: `${STATUS_ICONS.online}${invite.approximate_presence_count} online\t\t${STATUS_ICONS.offline}${invite.approximate_member_count} members`, value: `<:online:1152111668856361010>${invite.approximate_presence_count} online\t\t<:offline:1152111682886316042>${invite.approximate_member_count} members`,
inline: false, inline: false,
}, },
inviter, inviter,
@ -607,7 +600,7 @@ lookupinvite.callback = async function (msg, line) {
name: "Features", name: "Features",
value: value:
features.length > 0 features.length > 0
? features.slice(0, Math.floor(features.length / 2)).join("\n") ? features.slice(0, Math.ceil(features.length / 2)).join("\n")
: "None", : "None",
inline: true, inline: true,
}, },
@ -615,7 +608,7 @@ lookupinvite.callback = async function (msg, line) {
? { ? {
name: "\u200b", name: "\u200b",
value: features value: features
.slice(Math.floor(features.length / 2), features.length) .slice(Math.ceil(features.length / 2), features.length)
.join("\n"), .join("\n"),
inline: true, inline: true,
} }
@ -690,7 +683,7 @@ lookupinvite.callback = async function (msg, line) {
}, },
{ {
name: "Member Count", name: "Member Count",
value: `${STATUS_ICONS.offline}${invite.approximate_member_count} members`, value: `<:offline:1152111682886316042>${invite.approximate_member_count} members`,
inline: true, inline: true,
}, },
expires, expires,