diff --git a/src/modules/utility/userinfo.js b/src/modules/utility/userinfo.js index 96e913d..ca9c09d 100644 --- a/src/modules/utility/userinfo.js +++ b/src/modules/utility/userinfo.js @@ -6,6 +6,7 @@ const { ApplicationFlags, BadgeURLs, CDNEndpoints, + ClanPlaystyle, UserFlags, } = require("@util/dconstants.js"); const { @@ -246,9 +247,14 @@ userinfo.callback = async function (msg, line) { if (botDeleted) { descLines.push("*This bot's application has been deleted*"); } + let clanData; if (user.clan) { // TODO: badge emojis via color aproximation of the default presets - descLines.push(`**${user.clan.tag}** (\`${user.clan.identity_guild_id}\`)`); + descLines.push(`**${user.clan.tag}**`); + + clanData = await hf.bot.requestHandler + .request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true) + .catch(() => {}); } if (anyMember) { @@ -317,6 +323,12 @@ userinfo.callback = async function (msg, line) { } (\`${user.avatar_decoration_data.sku_id}\`)\n[Image](${decorationUrl})`, inline: true, }, + clanData && { + name: "Clan", + value: `${clanData.name} (\`${user.clan.identity_guild_id}\`)\n-# :video_game:${ + ClanPlaystyle[clanData.playstyle] + }${clanData.wildcard_descriptors.length > 0 ? ` \u2022 **${clanData.wildcard_descriptors.join(", ")}**` : ""}`, + }, member?.roles?.length > 0 && { name: "Roles", value: member.roles