mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
fix yt thumbnail issue, sync ctx and regular audio command
This commit is contained in:
parent
4e39b12073
commit
26562317ca
2 changed files with 20 additions and 9 deletions
|
@ -41,23 +41,27 @@ module.exports = {
|
|||
})
|
||||
let song = songlink.body.entitiesByUniqueId[songlink.body.entityUniqueId]
|
||||
|
||||
// YT Playlist thumbnails don't work properly
|
||||
if(songlink.body.entityUniqueId.startsWith("YOUTUBE_PLAYLIST") && Object.keys(songlink.body.entitiesByUniqueId).length >= 2){
|
||||
song.thumbnailUrl = songlink.body.entitiesByUniqueId[Object.keys(songlink.body.entitiesByUniqueId).filter((k)=>!k.startsWith("YOUTUBE_PLAYLIST"))[0]].thumbnailUrl
|
||||
}
|
||||
|
||||
let btns = renderMusicButtons(songlink.body.linksByPlatform)
|
||||
return editOrReply(context, {
|
||||
embeds: [
|
||||
createEmbed("default", context, {
|
||||
createEmbed("defaultNoFooter", context, {
|
||||
author: {
|
||||
name: `${song.title} by ${song.artistName}`.substr(0, 1000),
|
||||
iconUrl: song.thumbnailUrl,
|
||||
url: urls[0]
|
||||
},
|
||||
footer: {}
|
||||
}
|
||||
})
|
||||
], components: btns
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
return editOrReply(context, createEmbed("error", context, `Unable to perform song search.`))
|
||||
return editOrReply(context, createEmbed("warning", context, `No results found.`))
|
||||
}
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue