utility.linvite: fix feature list

This commit is contained in:
Cynthia Foxwell 2023-09-14 23:18:01 -06:00
parent b8c2b6766b
commit fdd712a237

View file

@ -551,18 +551,16 @@ lookupinvite.callback = async function (msg, line) {
}
: null;
const features = invite.guild.features
.map(
(feature) =>
(GUILD_FEATURES[feature]?.icon ?? "\u2753") +
" " +
(GUILD_FEATURES[feature]?.name ??
feature
.split("_")
.map((x) => x[0] + x.substring(1).toLowerCase())
.join(" "))
)
.join(", ");
const features = invite.guild.features.map(
(feature) =>
(GUILD_FEATURES[feature]?.icon ?? "\u2753") +
" " +
(GUILD_FEATURES[feature]?.name ??
feature
.split("_")
.map((x) => x[0] + x.substring(1).toLowerCase())
.join(" "))
);
if (invite.type == 0) {
embed.fields.push(
@ -609,17 +607,16 @@ lookupinvite.callback = async function (msg, line) {
name: "Features",
value:
features.length > 0
? features.slice(0, Math.floor(features.length / 2))
? features.slice(0, Math.floor(features.length / 2)).join("\n")
: "None",
inline: true,
},
features.length > 1
? {
name: "\u200b",
value: features.slice(
Math.floor(features.length / 2),
features.length
),
value: features
.slice(Math.floor(features.length / 2), features.length)
.join("\n"),
inline: true,
}
: null,