galnir / Master-Bot

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more
MIT License
464 stars 372 forks source link

Property is undefined #102

Closed ghost closed 4 years ago

ghost commented 4 years ago

My current issue is that commands like play q or etc give me a property of length is undefined. I am using discord.js version 12 V12 of node and v10 of commando . Your pinned message seems to say that I should be using version 11 but commando does not seem to have an eleventh version . I also made no changes to the index like delete any code etc but I don't really know how to fix it

galnir commented 4 years ago

Can you take a screenshot of the error you're getting? Did you clone this repo and then npm i?

ghost commented 4 years ago

wait my bad the issue is TypeError: Cannot read property 'length' of undefined at PlayCommand.run
However as i mentioned before , i have run npm i and also have the required versions , and run it on debian 9 To go into further detail , i am using version 12.2.0 of d.js and 0.10.0 for commando I have installed the needeed packages , have run npm and i still get property errors and none of the music commands work .

ghost commented 4 years ago

I'm having the same issue

ghost commented 4 years ago

When I enter a youtube URL, i get this, TypeError: Cannot read property 'hours' of undefined

ghost commented 4 years ago

Quick update , i did not get to fix the error yet but for those who have downloaded the disocrd.js-commando v 11 using npm install discordjs/Commando and run npm view discord-commando version and it says v10 it is because of the nodejs registry , are actually using v11-dev you can check within the node_modules/discord.js-commando/package.json and you shall see that u are using the correct version - But ye as i said still has the issue

ghost commented 4 years ago

Could be something to do with API limitation

galnir commented 4 years ago

@PeteZionDev you don't need to install the dependencies one by one. All you need to do after cloning this repo is simply run 'npm i' as the readme says. I also want to address what @pwneyy said because this came up in another issue. When using the search function of the play command(!play something and then choose from 1 to 5), the bot uses the YouTube Data API. Your daily quota limit is 10k per day. The search function costs 100 units, so using it too much makes your API key hit its daily quota limit which can throw errors. I'm looking into what can be done but it doesn't look promising. I contacted YouTube and got my quota raised to 1m

ghost commented 4 years ago

@PeteZionDev you don't need to install the dependencies one by one. All you need to do after cloning this repo is simply run 'npm i' as the readme says. I also want to address what @pwneyy said because this came up in another issue. When using the search function of the play command(!play something and then choose from 1 to 5), the bot uses the YouTube Data API. Your daily quota limit is 10k per day. The search function costs 100 units, so using it too much makes your API key hit its daily quota limit which can throw errors. I'm looking into what can be done but it doesn't look promising. I contacted YouTube and got my quota raised to 1m

So do you know what could have caused the property issue ?

galnir commented 4 years ago

Yes like I said, either quota limit which you can check on google API console or you didn't install the deps correctly

ghost commented 4 years ago

interesting , because i just made a complete new folder with the repo run npm with fresh config.json and i get TypeError: Cannot read property 'length' of undefined. So yep i do not know whats causing it , i havent hit the quota limit either

ghost commented 4 years ago

wait nvm u were right it was the api

Oplikk commented 4 years ago

How did you fix your issue?

ghost commented 4 years ago

@PeteZionDev where did you know that it was the API?

ghost commented 4 years ago

I didn't pass my quota

galnir commented 4 years ago

@pwneyy Make sure the api key you're placing in config.json is the correct one, if that doesn't work please open an issue so I can help you :)