https://www.npmjs.com/package/genius-lyrics是我使用的天才 api,
我正在尝试制作一个 >lyrics 命令,该命令使用在 DisTube 中播放的当前歌曲,并尝试通过从 DisTube 中提取当前歌曲名称然后通过 Genius Api 运行它来获取当前歌曲的歌词
currentsong 等于 distubes song.name
,如果我${currentsong}
用任何歌曲名称替换,则此处发布的代码有效,但如果它是变量则无效。我使用 console.log 来显示 firstSong,它返回 undefined 但如果我使用 console.log 来显示 currentsong,它会显示歌曲名称。如何为歌词使用变量?
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");
同样,当我运行我的机器人时,它会出现 HTTPError: Response code 403 错误,但这可能是无关的