userinfo: fixes

This commit is contained in:
Cynthia Foxwell 2025-07-10 18:22:33 -06:00
parent e9b8b114ef
commit b651101637
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -339,8 +339,15 @@ userinfo.callback = async function (msg, line) {
const shared = Array.from(hf.bot.guilds.values()).filter((g) => g.members.get(id) != null);
const descLines = [`# ${user.global_name ?? user.username} ${user.bot ? Icons.boat.replace(":i:", ":Bot:") : ""}`];
let subline = `${formatUsername(user).replace("@", "")} \u2022 <@${id}>`;
const descLines = [
`# ${member?.nick ? member.nick : user.global_name ?? user.username} ${
user.bot ? Icons.boat.replace(":i:", ":Bot:") : ""
}`,
];
let subline = `${member?.nick ? `(${user.global_name ?? user.username}) \u2022` : ""}${formatUsername(user).replace(
"@",
""
)} \u2022 <@${id}>`;
if (badges.length > 0) {
subline += "\u2007" + badges.join("");
}
@ -423,6 +430,9 @@ userinfo.callback = async function (msg, line) {
thumbnail: {
url: guildAvatar || avatar,
},
image: {
url: guildBanner || banner,
},
description: descLines.join("\n"),
fields: [
{
@ -430,12 +440,7 @@ userinfo.callback = async function (msg, line) {
value: `<t:${Math.floor(snowflakeToTimestamp(id) / 1000)}:D>${
member ? ` \u2022 <t:${Math.floor(member.joinedAt / 1000)}:D>` : ""
}`,
inline: true,
},
member?.nick && {
name: "Nickname",
value: member.nick,
inline: true,
inline: false,
},
user.avatar_decoration_data && {
name: `Avatar Decoration ${user.avatar_decoration_data.asset.startsWith("a_") ? "(Animated)" : ""}`,
@ -461,7 +466,7 @@ userinfo.callback = async function (msg, line) {
value: member.roles
.sort((a, b) => guild.roles.get(b).position - guild.roles.get(a).position)
.map((role) => `<@&${role}>`)
.join("\u2007"),
.join("\u2002"),
inline: false,
},
images.length > 0 && {
@ -476,15 +481,7 @@ userinfo.callback = async function (msg, line) {
};
return {
embeds: [
banner && {
color: embed.color,
image: {
url: guildBanner || banner,
},
},
embed,
].filter((x) => !!x),
embeds: [embed],
};
};
hf.registerCommand(userinfo);