move to discord proxy for images, add lanyard hb, #6

This commit is contained in:
creations 2025-04-06 21:41:53 -04:00
parent c79ee2b203
commit 7d78a74a25
Signed by: creations
GPG key ID: 8F553AA4320FC711
2 changed files with 42 additions and 18 deletions

View file

@ -78,7 +78,10 @@
const img = activity.assets?.large_image;
let art = null;
if (img?.includes("https")) {
if (img?.startsWith("mp:external/")) {
art = `https://media.discordapp.net/external/${img.slice("mp:external/".length)}`;
} else if (img?.includes("/https/")) {
const clean = img.split("/https/")[1];
if (clean) art = `https://${clean}`;
} else if (img?.startsWith("spotify:")) {
@ -87,6 +90,7 @@
art = `https://cdn.discordapp.com/app-assets/${activity.application_id}/${img}.png`;
}
const activityTypeMap = {
0: "Playing",
1: "Streaming",