Fix weird behaviors with mp:external I hope
This commit is contained in:
parent
7c89ef047d
commit
7a3d81ce4a
1 changed files with 3 additions and 1 deletions
4
index.js
4
index.js
|
@ -75,7 +75,9 @@ function get_img_url(activity, size = "large_image") {
|
|||
var image = activity.assets[size]
|
||||
|
||||
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))
|
||||
} else if (image.includes("spotify")) {
|
||||
return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length))
|
||||
|
|
Loading…
Reference in a new issue