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

XXX Is not a function #103

Closed Oplikk closed 4 years ago

Oplikk commented 4 years ago

Describe the bug i keep getting error XXX is not a function (the XXX are multiple commands My main guess is, that i dont have some dependency installed or something similar, but need help investigating

Screenshots https://imgur.com/a/cIxi0y6

Desktop (please complete the following information):

Additional context Exact copy of the code or a code with a deleted function. installed dependecies by npm i , Exact copy of the code shows a error TypeError: Cannot read property 'hours' of undefined When deleting line 290 to 301 in play.js, the error is the one described above, about missing a function : https://imgur.com/a/cIxi0y6

ghost commented 4 years ago

Describe the bug i keep getting error XXX is not a function (the XXX are multiple commands My main guess is, that i dont have some dependency installed or something similar, but need help investigating

Screenshots https://imgur.com/a/cIxi0y6

Desktop (please complete the following information):

  • OS: Windows 10 v2004 -Node v14.4.0
  • FFMPEG+ Python 2.7 installed
  • Local hosting (launching throught VisualStudioCode

Additional context Exact copy of the code or a code with a deleted function. installed dependecies by npm i , Exact copy of the code shows a error TypeError: Cannot read property 'hours' of undefined When deleting line 290 to 301 in play.js, the error is the one described above, about missing a function : https://imgur.com/a/cIxi0y6

Hey , check your discord.js and discord.js-commando version , you should be running v11-dev of commando and v12 discord.js To install the correct discord.js-commando version run npm install discordjs/Commando To install discord.js version 12 use npm install discord.js also make sure you install nodejs v10 or 12 , 12 is good and retry

Oplikk commented 4 years ago

Describe the bug i keep getting error XXX is not a function (the XXX are multiple commands My main guess is, that i dont have some dependency installed or something similar, but need help investigating Screenshots https://imgur.com/a/cIxi0y6 Desktop (please complete the following information):

  • OS: Windows 10 v2004 -Node v14.4.0
  • FFMPEG+ Python 2.7 installed
  • Local hosting (launching throught VisualStudioCode

Additional context Exact copy of the code or a code with a deleted function. installed dependecies by npm i , Exact copy of the code shows a error TypeError: Cannot read property 'hours' of undefined When deleting line 290 to 301 in play.js, the error is the one described above, about missing a function : https://imgur.com/a/cIxi0y6

Hey , check your discord.js and discord.js-commando version , you should be running v11-dev of commando and v12 discord.js To install the correct discord.js-commando version run npm install discordjs/Commando To install discord.js version 12 use npm install discord.js also make sure you install nodejs v10 or 12 , 12 is good and retry

Hey there, hecked all the versions, commando does not match up, i have v10 instead of v11, but everytime i do npm install discord.js/commando it tells me it is installing v11, but after the process is done , i still have v10 installed isntead of v11. Any idea what to do?

galnir commented 4 years ago

Did you clone this repo and then hit 'npm i' in your terminal? You don't need to install the dependencies individually

Oplikk commented 4 years ago

Did you clone this repo and then hit 'npm i' in your terminal? You don't need to install the dependencies individually

Yes i did

galnir commented 4 years ago

I don't understand, why did you delete those lines of code? You basically deleted a function and then got an error that there is a missing function

Oplikk commented 4 years ago

I don't understand, why did you delete those lines of code? You basically deleted a function and then got an error that there is a missing function

the error does not refer to the deleted line, AND IS PRESENT when the code is raw copied

galnir commented 4 years ago

Did it work before? You might have hit the API quota limit based on the "there was a problem getting the video you requested"

Oplikk commented 4 years ago

Did it work before? You might have hit the API quota limit based on the "there was a problem getting the video you requested"

It does not work at all, not a single successful command. I think there is something wrong globally, the other issue posted there o github is the same thing

galnir commented 4 years ago

I've cloned and run this repo probably dozens of times on different operating systems and constantly test it. Did you put a correct YouTube API key in config.json? 99% of the issues about something being "undefined" came down to not following the instructions on the readme or not generating or simply not pasting a correct API key in config.json

Oplikk commented 4 years ago

After rebooting getting a new error @Oplik, An error occurred while running the command: TypeError: this.formatDuration is not a function You shouldn't ever receive an error like this. Please contact Oplik#3944.

galnir commented 4 years ago

You should not get this error if you didn't modify anything in code. This bot is really not hard to get working, all you gotta do is clone this repo, npm i, put your id in index.js and make sure you generate the correct API keys. I'm quite confident your YouTube API key is either wrong or you hit the quota (and please check this so we can be sure)

Oplikk commented 4 years ago

You should not get this error if you didn't modify anything in code. This bot is really not hard to get working, all you gotta do is clone this repo, npm i, put your id in index.js and make sure you generate the correct API keys. I'm quite confident your YouTube API key is either wrong or you hit the quota (and please check this so we can be sure)

Still have API quota to spare (only 1 request have been made) - api from Youtube api v3 Code is copied, i then did npm i - that installed all the dependency, i have node v 14.4, python 2.7 and ffmpeg. Still keep getting the error

Natemo2625 commented 4 years ago

Does the error show up in logs or just on discord

galnir commented 4 years ago

@Oplikk it comes down to two options:

  1. The API key you put in your config.json is not the right one or the correct one.
  2. What do you mean code is copied? Did you clone this repo with Git? This is not a "global" problem, this is on your end

I'm sorry I'm not able to help you much, the reason is that I can't figure out what is wrong without knowing what you did exactly. If you follow the instructions carefully(like 100's of people do weekly), you will have no issues

Oplikk commented 4 years ago

Closing issue, strangely resolved after VisualStudio Reinstallation. Anyways thanks for your time and the now well working bot!