Works now ??

This commit is contained in:
bingus_violet 2024-10-13 16:01:46 -05:00
parent e024247160
commit 68108e78ab

View file

@ -8,7 +8,9 @@ function get_img_url(activity, size = "large_image") {
var image = activity.assets[size] var image = activity.assets[size]
if (image) { if (image) {
if (image.includes("https/")) { if (image.includes("mp:external")) {
return ('https://media.discordapp.net/external' + image.substr(image.indexOf('mp:external') + 11, image.length))
} else if (image.includes("https/")) {
return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length)) return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length))
} else if (image.includes("spotify")) { } else if (image.includes("spotify")) {
return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length)) return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length))
@ -19,11 +21,14 @@ function get_img_url(activity, size = "large_image") {
} }
if (!image && size == "large_image") { if (!image && size == "large_image") {
if (activity.name in activityImages) {
return decodeURIComponent(activityImages[activity.name])
}
} }
return null return null
} }
function makeCompat(string="") { function makeCompat(string="") {
return string.replaceAll("<", "&lt;").replaceAll(">", "&gt;") return string.replaceAll("<", "&lt;").replaceAll(">", "&gt;")
} }