mariusbegby / cadence-discord-bot

🎶 Cadence - The free Discord music bot. Open source and community-driven!
MIT License
71 stars 30 forks source link

Seems like files missing !!! #427

Closed GokulSamraj closed 6 months ago

GokulSamraj commented 6 months ago

It seems like some bot files are missing which throws error in both dependency and and run time errors

kindly add those missing files and update the package.json versions

mariusbegby commented 6 months ago

@GokulSamraj What errors? Please provide more details.

mariusbegby commented 6 months ago

If you cannot provide more details, I will close this. You can use prebuilt Docker images here if you struggle with setting up your own environment correctly: https://hub.docker.com/r/mariusbegby/cadence/tags

Also, next time, please show some more respect, remember it is an open source project where people contribute their time for free. If you aren't satisfied with this bot then use another one, or fix the issues yourself (if you have the skill, n00b).

          It seems to be a cool idea but is this developer even sees the issues and working for the fixes?

Originally posted by @GokulSamraj in https://github.com/mariusbegby/cadence-discord-bot/issues/337#issuecomment-2085620202

GokulSamraj commented 6 months ago

LMAO chill dude you are the one who didnt reply to that user who requested a feature within 20 min you closed my issue and calling me a noob 😂

heres the issue i face image

image

i was replicating the issue i faced before few hours

mariusbegby commented 6 months ago

@GokulSamraj what version of Node.js are you running?

Is this updated code from main branch, if not, which commit?

I need more details to reproduce. It is working fine here:

image

GokulSamraj commented 6 months ago

image

main branch windows 10 using node version manager (i used this thing in ubuntu previously and now using on windows)

your bot is perfectly fine for me , previously i used in replit and recently on ubuntu self host every time it worked fine ,except this new version . i recently switched to windows where all the problem started for me .

mariusbegby commented 6 months ago

I haven't tested Node.js v22 yet on Cadence.

Cadence is built to work on latest LTS version, which is currently v20. If you switch to Node.js v20 I am sure it will work again for you. There shouldn't be any issues in terms of Windows vs Linux, I use both myself (Windows on local development, Linux in production).

Node.js v22 will become LTS in October, and so I will test it properly and make required changes before that. I am still quite busy but from the summer I will finally start having free time again to work on hobby projects. So stay tuned for more updates.

Let me know if you face issues with v20, but for now this seems like an issue only on your machine (unsupported version) ,so I will keep this closed.

GokulSamraj commented 6 months ago

thanks , version 20 fixed the issue but few hours back it throwed a lot of error even in npm i i lost hope that i can use a music bot anymore tbh your bot is way more stable after installation

image

mariusbegby commented 6 months ago

Good to hear it works now.

On main branch there's a few dependencies having "vulnerability" warnings due to depending on vulnerable version of undici, however these are not actually something to worry about.

GokulSamraj commented 6 months ago

sadly after a system restart this error happend this is what i faced previously

image

pryzmian commented 6 months ago

Unexpected token '}'

mariusbegby commented 6 months ago

config npm package is used to load the configuration from /config/ folder.

It seems one of the config files are not formatted properly, hence Unexpected token '}' error as @pryzmian mentioned.

The config file uses normal object structure. If you are unable to fix it, please provide all files inside /config/ folder. ChatGPT might unironically help you find the issue also if you send it the error and file contents.

I can reproduce the error by intentionally putting invalid syntax in the config file: image

> cadence-discord-bot@5.7.0 start
> node .

E:\cadence-discord-bot\node_modules\config\lib\config.js:855
    throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
    ^

Error: Cannot parse config file: 'E:\cadence-discord-bot\config\default.js': SyntaxError: Unexpected token '{'
    at util.parseFile (E:\cadence-discord-bot\node_modules\config\lib\config.js:855:11)
    at E:\cadence-discord-bot\node_modules\config\lib\config.js:651:28
    at Array.forEach (<anonymous>)
    at util.loadFileConfigs (E:\cadence-discord-bot\node_modules\config\lib\config.js:650:16)
    at new Config (E:\cadence-discord-bot\node_modules\config\lib\config.js:116:27)
    at Object.<anonymous> (E:\cadence-discord-bot\node_modules\config\lib\config.js:1515:33)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)

Node.js v20.12.0

If you are using VS Code, I recommend using this extension and opening the config file. You should see errors in syntax highlighted very clearly (see screenshot) image

GokulSamraj commented 6 months ago

@mariusbegby the isssue is fixed, thanks ✌

GokulSamraj commented 6 months ago

nvm , a new issue started for both your own bot and the one i folked image

mariusbegby commented 6 months ago

@GokulSamraj that is an extrordinary issue that happened due to one of our dependencies, youtube-ext. The issue was external and affected all bots running with youtube-ext as backend for getting tracks from youtube (and spotify).

Please join the support server for information like this.

mariusbegby commented 6 months ago

Temporary fix:

const player: Player = new Player(client, {
    useLegacyFFmpeg: false,
    skipFFmpeg: false,
    ytdlOptions: {
        quality: 'highestaudio',
        highWaterMark: 1 << 25,
        // no ipRotationConfig here
        requestOptions: {
            headers: {
                cookie: process.env.YT_COOKIE || ''
            }
        }
    }
});

Then npm run build and restart.

GokulSamraj commented 6 months ago

this temporary fix worked as charm @mariusbegby also joined your discord channel waiting for a permanent fix

mariusbegby commented 6 months ago

Nice. Stay tuned for updates in the Discord server. The fix needs to be issued by package maintainer for the dependency package youtube-ext, unfortunately out of my control. I will update on Discord when fix is available (commit to bump version number of dependency)

xtcorp commented 6 months ago

Faced the same problem of "Unknown Integration". Re-inviting bot with discord's new "installation" tab somehow fixed it

2024-05-06_04-48

Literally lost hours of using different node versions, rebuilding, redeploying, cloning again, etc