https://www.npmjs.com/package/genius-lyrics is the genius api im using,
I am trying to make a >lyrics command that uses the current song playing in DisTube and tries to get the lyrics of the current song by pulling the current song name from DisTube and then running it through Genius Api
currentsong is equal to distubes song.name
, the code posted here works if I replace ${currentsong}
with any name of a song but not if its a variable. I used console.log to display firstSong and it returns undefined but if i use console.log to display currentsong it displays the songs name. How can I use a variable for the lyrics?
const searches = await Client.songs.search(`${currentsong}`);
// Pick first one
const firstSong = searches[0];
console.log("About the Song:\n", firstSong, "\n");
// Ok lets get the lyrics
const lyrics = await firstSong.lyrics();
console.log("Lyrics of the Song:\n", lyrics, "\n");
also when I run my bot it gives an error of HTTPError: Response code 403 but that may be unrelated
Fixed it, heres the solution incase anyone has the same problem