userinfo: where nameplate image

This commit is contained in:
Cynthia Foxwell 2025-07-16 16:03:48 -06:00
parent 96fd672ec8
commit c515f1d401
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -500,7 +500,7 @@ userinfo.callback = async function (msg, line) {
}; };
let nameplateEmbed; let nameplateEmbed;
const files = []; const attachments = [];
if (user.collectibles?.nameplate) { if (user.collectibles?.nameplate) {
const {nameplate} = user.collectibles; const {nameplate} = user.collectibles;
const palette = NameplatePalettes[nameplate.palette]; const palette = NameplatePalettes[nameplate.palette];
@ -526,9 +526,9 @@ userinfo.callback = async function (msg, line) {
{input: await bg_light.toBuffer(), gravity: "north"}, {input: await bg_light.toBuffer(), gravity: "north"},
{input: await bg_dark.toBuffer(), gravity: "south"}, {input: await bg_dark.toBuffer(), gravity: "south"},
]); ]);
files.push({ attachments.push({
contents: await final.png().toBuffer(), file: await final.png().toBuffer(),
name: "nameplate.png", filename: "nameplate.png",
}); });
imageUrl = "attachment://nameplate.png"; imageUrl = "attachment://nameplate.png";
} catch { } catch {
@ -557,7 +557,7 @@ userinfo.callback = async function (msg, line) {
return { return {
embeds: [embed, nameplateEmbed].filter((x) => !!x), embeds: [embed, nameplateEmbed].filter((x) => !!x),
files, attachments,
}; };
}; };
hf.registerCommand(userinfo); hf.registerCommand(userinfo);