diff --git a/src/modules/utility/guildinfo.js b/src/modules/utility/guildinfo.js index cc098e8..d5c8dd6 100644 --- a/src/modules/utility/guildinfo.js +++ b/src/modules/utility/guildinfo.js @@ -9,6 +9,7 @@ const { CDNEndpoints, ClanPlaystyle, ExplicitContentFilterStrings, + Games, Permissions, VerificationLevelStrings, } = require("../../util/dconstants.js"); @@ -76,6 +77,17 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) { if (clan) { const images = []; + const games = await Promise.all( + clan.game_ids.map(async (id) => { + let game = Games.find((x) => x.id == id); + if (!game) { + game = await hf.bot.requestHandler.request("GET", APIEndpoints.APPLICATION_RPC(snowflake), false); + } + + return `${game.name} (\`${id}\`)`; + }) + ); + clanEmbed = { title: _guild != null ? "Clan data" : clan.name, description: clan.description ?? "*No description*", @@ -106,8 +118,8 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) { inline: false, }, { - name: "Associated Game IDs", - value: `\`${clan.game_ids.map((x) => `"${x}"`).join(", ")}\``, + name: "Associated Games", + value: `- ${games.join("\n- ")}`, inline: false, }, {