mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
error message
This commit is contained in:
parent
5b214ebab1
commit
58938c74c2
1 changed files with 23 additions and 15 deletions
|
@ -59,7 +59,10 @@ module.exports = {
|
|||
// API lowkey sucks, fetch more metadata via songlink
|
||||
let url = audioSearch.response.body.media[Object.keys(audioSearch.response.body.media)[0]]
|
||||
if(audioSearch.response.body.media.deezer) url = audioSearch.response.body.media.deezer
|
||||
if(audioSearch.response.body.media.napster) url = audioSearch.response.body.media.napster
|
||||
if(audioSearch.response.body.media.apple_music) url = audioSearch.response.body.media.apple_music
|
||||
if(audioSearch.response.body.media.spotify) url = audioSearch.response.body.media.spotify
|
||||
try{
|
||||
let songlink = await superagent.get(`https://api.song.link/v1-alpha.1/links?url=${encodeURIComponent(url)}`)
|
||||
//get song meta
|
||||
let song = songlink.body.entitiesByUniqueId[songlink.body.entityUniqueId]
|
||||
|
@ -75,6 +78,11 @@ module.exports = {
|
|||
footer: {}
|
||||
})
|
||||
], components: btns})
|
||||
}catch(e){
|
||||
return editOrReply(context, {embeds: [
|
||||
createEmbed("error", context, "Links for this song are unavailable..")
|
||||
]})
|
||||
}
|
||||
}
|
||||
|
||||
}catch(e){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue