presence: cover image support

This commit is contained in:
Cynthia Foxwell 2025-10-15 12:14:04 -06:00
parent de126e9268
commit b66568e546
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -408,6 +408,19 @@ presence.callback = async function (msg, line) {
}
image_links.push({label: "Small Image", url: fixMediaProxyURL(smallUrl)});
}
if (activity.assets.invite_cover_image) {
let coverUrl;
if (activity.assets.invite_cover_image.startsWith("mp:")) {
coverUrl = activity.assets.invite_cover_image.replace("mp:", "https://media.discordapp.net/");
} else if (activity.assets.invite_cover_image.startsWith("spotify:")) {
coverUrl = activity.assets.invite_cover_image.replace("spotify:", "https://i.scdn.co/image/");
} else {
coverUrl = CDNEndpoints.APP_ASSET(activity.application_id, activity.assets.invite_cover_image);
}
image_links.push({label: "Cover Image", url: fixMediaProxyURL(coverUrl)});
}
}
if (activity.application_id && !activity.assets?.large_image && !activity.assets?.small_image) {