zyrouge / node-genius-lyrics

Simple lyrics fetcher that uses Genius. Also has official API implementations.
https://genius-lyrics.js.org
MIT License
61 stars 12 forks source link

Got an error and success response at the same time #42

Closed Uryaaa closed 1 year ago

Uryaaa commented 1 year ago

My code is look like this

const Genius = require("genius-lyrics");
const gclient = new Genius.Client('super-secret');

module.export = {//something to export//}

async function getLyrics(lyrics) {
    const searches = await gclient.songs.search(lyrics);
    const first = searches[0]
    return first
}
getLyrics('noma - brain power').then(async(res)=>{
    console.log(res.lyrics())

        //     message.reply([
    //         {
    //             type: "image",
    //             originalContentUrl:res.image,
    //             previewImageUrl:res.image
    //         },
    //         {
    //             type:"text",
    //             text:`${res.artist.name} - ${res.title}

    // ${res.lyrics()}`
    //         }
    //     ])  
})

for a messaging bot app and somehow if i uncomment the message.reply() part it give me an error but successfully fetched the data via console.log() hence i got an error and success response, i also check if the previous version (2.9.4) works and it did works but after few request i got the same cloudflare error LMAO but this time i couldn't get success response at all.

got no problem when i tested on my local before running it using Replit

Do you have any idea what is happened?

zyrouge commented 1 year ago

Related to #41. Mostly occurs when you use cloud servers to access the website. You can keep track of this issue there. Closing this.