lookupinvite: fix no features error

This commit is contained in:
Cynthia Foxwell 2024-08-30 18:58:14 -06:00
parent 8e7bd2a1d9
commit 83c0b226eb

View file

@ -121,20 +121,18 @@ lookupinvite.callback = async function (msg, line) {
if (invite.guild.features) { if (invite.guild.features) {
const features = formatGuildFeatures(invite.guild.features); const features = formatGuildFeatures(invite.guild.features);
embed.fields.push( embed.fields.push({
{ name: `Features (${features.length})`,
name: `Features (${features.length})`, value: features.length > 0 ? features.slice(0, Math.ceil(features.length / 2)).join("\n") : "None",
value: features.length > 0 ? features.slice(0, Math.ceil(features.length / 2)).join("\n") : "None", inline: true,
});
if (features.length > 1) {
embed.fields.push({
name: "\u200b",
value: features.slice(Math.ceil(features.length / 2), features.length).join("\n"),
inline: true, inline: true,
}, });
features.length > 1 }
? {
name: "\u200b",
value: features.slice(Math.ceil(features.length / 2), features.length).join("\n"),
inline: true,
}
: null
);
} }
const guildIcon = invite.guild?.icon && CDNEndpoints.GUILD_ICON(invite.guild.id, invite.guild.icon); const guildIcon = invite.guild?.icon && CDNEndpoints.GUILD_ICON(invite.guild.id, invite.guild.icon);