From e0a033266a74d78acfe68ceec20a649f9d6d338c Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Sun, 24 Nov 2024 21:54:34 -0600 Subject: [PATCH] Fix nitro emojis --- pageUpdater.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pageUpdater.js b/pageUpdater.js index db51641..bc34857 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -554,18 +554,13 @@ api.events.on("lanyardUpdate", async () => { pregenerate() } - for (var i = 0; i < api.lanyard.activities.length; i++) { - var activity = api.lanyard.activities[i] - if (activity.type == 4 && activity.emoji) { - - if (activity.emoji.id) { - if (activity.emoji.animated) { - var emoji = Buffer.from(await (await fetch(`https://cdn.discordapp.com/emojis/${activity.emoji.id}.gif?quality=lossless`)).arrayBuffer()) - } else { - var emoji = Buffer.from(await (await fetch(`https://cdn.discordapp.com/emojis/${activity.emoji.id}.png?quality=lossless`)).arrayBuffer()) - } - fs.writeFileSync(path.join(__dirname, "cached/emojis", activity.emoji.id), emoji) - } + var status = api.lanyard.custom_status + if (status.emoji.id) { + if (status.emoji.animated) { + var emoji = Buffer.from(await (await fetch(`https://cdn.discordapp.com/emojis/${status.emoji.id}.gif?quality=lossless`)).arrayBuffer()) + } else { + var emoji = Buffer.from(await (await fetch(`https://cdn.discordapp.com/emojis/${status.emoji.id}.png?quality=lossless`)).arrayBuffer()) } + fs.writeFileSync(path.join(__dirname, "cached/emojis", status.emoji.id), emoji) } }) \ No newline at end of file