guildinfo: split the list

This commit is contained in:
Cynthia Foxwell 2025-06-21 11:04:01 -06:00
parent cd46617113
commit 0d5895e06a
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -88,7 +88,9 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
game = await hf.bot.requestHandler.request("GET", APIEndpoints.APPLICATION_RPC(id), false); game = await hf.bot.requestHandler.request("GET", APIEndpoints.APPLICATION_RPC(id), false);
} }
return `${game.name}${profile.game_activity[id]?.activity_level > 1 ? " :fire:" : ""}\n-# \u200b\u3000${id}`; return `${game.name}${
profile.game_activity[id]?.activity_level > 1 ? " \ud83d\udd25" : ""
}\n-# \u200b\u3000${id}`;
}) })
); );
@ -126,15 +128,8 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
} }
} }
let gameLines = ""; const gamesLeft = games.slice(0, Math.ceil(games.length / 2)).join("\n");
let gameLines2 = ""; const gamesRight = games.slice(Math.ceil(games.length / 2), games.length).join("\n");
for (const line of games) {
if (gameLines.length + line.length + 1 <= 1024) {
gameLines += line + "\n";
} else {
gameLines2 += line + "\n";
}
}
clanEmbed = { clanEmbed = {
color: profile.brand_color_primary ? parseInt(profile.brand_color_primary.replace("#", "0x")) : 0, color: profile.brand_color_primary ? parseInt(profile.brand_color_primary.replace("#", "0x")) : 0,
@ -161,12 +156,17 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
}, },
games.length > 0 && { games.length > 0 && {
name: "Associated Games", name: "Associated Games",
value: gameLines, value: gamesLeft,
inline: false, inline: true,
}, },
gameLines2 != "" && { gamesRight != "" && {
name: "\u200b", name: "\u200b",
value: gameLines2, value: gamesRight,
inline: true,
},
games.length > 0 && {
name: "\u200b",
value: "\u200b",
inline: false, inline: false,
}, },
profile.badge_color_primary && { profile.badge_color_primary && {