presence: cover image support
This commit is contained in:
parent
de126e9268
commit
b66568e546
1 changed files with 13 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue