Works now ??
This commit is contained in:
parent
e024247160
commit
68108e78ab
1 changed files with 7 additions and 2 deletions
|
@ -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("<", "<").replaceAll(">", ">")
|
return string.replaceAll("<", "<").replaceAll(">", ">")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue