userinfo: move clan tag to author field

This commit is contained in:
Cynthia Foxwell 2024-08-19 21:34:13 -06:00
parent 33065b8aa6
commit bdb94e3754

View file

@ -307,14 +307,10 @@ userinfo.callback = async function (msg, line) {
descLines.push("**System account**");
}
let clanData;
if (user.clan) {
// TODO: badge emojis via color aproximation of the default presets
if (user.clan.tag) descLines.push(`**${user.clan.tag}**`);
if (user.clan.identity_guild_id)
clanData = await hf.bot.requestHandler
.request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true)
.catch(() => {});
if (user.clan?.identity_guild_id) {
clanData = await hf.bot.requestHandler
.request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true)
.catch(() => {});
}
if (anyMember) {
@ -350,6 +346,12 @@ userinfo.callback = async function (msg, line) {
const embed = {
color: getTopColor(msg, id, user.accent_color ?? pastelize(id)),
author: clanData
? {
icon_url: CDNEndpoints.CLAN_BADGE(clanData.id, clanData.badge_hash),
name: clanData.tag,
}
: null,
thumbnail: {
url: avatar,
},