userinfo: system account marker, mention, nullcheck avatar for nitro badge

This commit is contained in:
Cynthia Foxwell 2024-08-15 16:07:59 -06:00
parent 471329a368
commit dd781eb5b2

View file

@ -145,7 +145,7 @@ userinfo.callback = async function (msg, line) {
if ((user.flags & UserFlags.PREMIUM_EARLY_SUPPORTER) !== 0) { if ((user.flags & UserFlags.PREMIUM_EARLY_SUPPORTER) !== 0) {
badges.push(`[${Icons.badges.early_supporter}](${BadgeURLs.early_supporter})`); badges.push(`[${Icons.badges.early_supporter}](${BadgeURLs.early_supporter})`);
} }
if ((user.banner || user.avatar.startsWith("a_")) && !user.bot) { if ((user.banner || user.avatar?.startsWith("a_")) && !user.bot) {
badges.push(`[${Icons.badges.premium}](${BadgeURLs.premium})`); badges.push(`[${Icons.badges.premium}](${BadgeURLs.premium})`);
} }
@ -217,6 +217,10 @@ userinfo.callback = async function (msg, line) {
botDeleted = true; botDeleted = true;
} }
} }
if (user.system) {
botDeleted = false;
}
} }
if (user.avatar_decoration_data?.expires_at || user.avatar_decoration_data?.sku_id == "1226939756617793606") { if (user.avatar_decoration_data?.expires_at || user.avatar_decoration_data?.sku_id == "1226939756617793606") {
@ -292,13 +296,16 @@ userinfo.callback = async function (msg, line) {
const shared = Array.from(hf.bot.guilds.values()).filter((g) => g.members.get(id) != null); const shared = Array.from(hf.bot.guilds.values()).filter((g) => g.members.get(id) != null);
const descLines = []; const descLines = [`<@${id}>`];
if (badges.length > 0) { if (badges.length > 0) {
descLines.push(badges.join("")); descLines.push(badges.join(""));
} }
if (botDeleted) { if (botDeleted) {
descLines.push("*This bot's application has been deleted*"); descLines.push("*This bot's application has been deleted*");
} }
if (user.system) {
descLines.push("**System account**");
}
let clanData; let clanData;
if (user.clan) { if (user.clan) {
// TODO: badge emojis via color aproximation of the default presets // TODO: badge emojis via color aproximation of the default presets