LengoLabs / qbot

Qbot is an advanced, easy to setup, free, and unbranded Discord-Roblox ranking bot. If at any time during setting it up you need assistance, you can join the support server.
https://discord.gg/J47m7t4
MIT License
77 stars 138 forks source link

Can't use variable before its declared. #70

Closed TheShadowGamer closed 3 years ago

TheShadowGamer commented 3 years ago

Throughout lines 28-60, you attempt to use client.config which you cannot use since it is not defined until later. The fix would be to move the client.config = config higher up, as I have done.

TheShadowGamer commented 3 years ago

Path is sometimes used, but its never installed with npm i. An example would be line 3 of approve-join.js. I have fixed that in my last commit.

yogurtsyum commented 3 years ago

Path is sometimes used, but its never installed with npm i. An example would be line 3 of approve-join.js. I have fixed that in my last commit.

Because it's built into Node.js. 🙃

TheShadowGamer commented 3 years ago

Weird, as it errored when I tried using require path for something I'll PR soon. Still safe to have it in the package.json in my opinion, but that is up to you.

yogurtsyum commented 3 years ago

Wouldn't it be less safe? Because then you're relying on the people who have the npm package "path" to keep it 100% updated to the built in package.

TheShadowGamer commented 3 years ago

I suppose. I'm not sure why path would fail to require if it is built into Node.js.

yogurtsyum commented 3 years ago

Anyways, can you please remove it from the package.json so I can merge this pull request? Thanks.

TheShadowGamer commented 3 years ago

Alright will do.