userinfo: extended clan info
This commit is contained in:
parent
147ea8997a
commit
97214e58b6
1 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue