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

I have no permission to join #512

Closed Jaccosf closed 3 years ago

Jaccosf commented 3 years ago

Do not open an issue if you simply "copied" code over to your bot/another bot. This is absolutely not recommended and will cause bugs. Also do not open an issue if you modified code and added features and now it's not working right. This is because I can't figure it out and don't have the time to read your code and find out what you did wrong.

Describe the bug When I try to play music or the music-quiz, the bot will join, but it won't play any music.

Desktop (please complete the following information):

Additional context Tried already to do the same that is provided in other issues: npm i node-opus delete node_modules and install with npm i npm i ytdl-core npm i better-sqlite3 npm i ffmpeg-static

but no luck.

galnir commented 3 years ago

I forgot to update the issue template to display that the nodejs version needs to be v14 atleast, so make sure to update it

Natemo2625 commented 3 years ago

Node has to be v14? I'm using Node v12.22.1 with no issues

galnir commented 3 years ago

Node has to be v14? I'm using Node v12.16.1 with no issues

Weird, discord.js updated their docs and it now says v14 is required. Anyway, @Jaccosf if after updating your node version to v14 the issue still persists let me know here (I'm keeping this issue open for now)

Jaccosf commented 3 years ago

Running on v14.16.1 now, unfortunately no difference.

Jaccosf commented 3 years ago

I don't know if it helps you, but when I ran npm i again, after downloading v14.16.1, I got this npm warnings: unknown6

Natemo2625 commented 3 years ago

Those warnings aren't causing the issue, as I get those same warnings and don't have any problems, all I can think of is reinstalling ffmpeg-static, but you've already done that

galnir commented 3 years ago

Are you hosting the bot on a Windows VPS?

galnir commented 3 years ago

Can you also add an 'error' parameter('function(error)') in line 369 (play.js), and add a 'console.log(error)' to the next line and paste here the error message

Jaccosf commented 3 years ago

I will do tomorrow!

navidmafi commented 3 years ago

if you problem is not solved can you try and installing dependencies with Windows Command Prompt? it appears you are using git bash it does not work for me and failed. can you delete node_modules and try using npm i in CMD?

Jaccosf commented 3 years ago

Can you also add an 'error' parameter('function(error)') in line 369 (play.js), and add a 'console.log(error)' to the next line and paste here the error message

I've added this, but I didn't get a console log...

Jaccosf commented 3 years ago

if you problem is not solved can you try and installing dependencies with Windows Command Prompt? it appears you are using git bash it does not work for me and failed. can you delete node_modules and try using npm i in CMD?

This didn't help unfortunately.

galnir commented 3 years ago

Does it happen only when using the music-trivia command or also with the play command?

Jaccosf commented 3 years ago

Does it happen only when using the music-trivia command or also with the play command?

both

galnir commented 3 years ago

Does it happen only when using the music-trivia command or also with the play command?

both

Do the following steps:

  1. Pull the new changes (git pull)
  2. In play.js change line 431 to this: .catch(function(error) {
  3. add to the next line this: console.log(error)

It's really odd that you said it didn't output anything to your console, so please pull the newest changes and try again. Let me know here if it doesn't output anything again

Jaccosf commented 3 years ago

`Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds. at VoiceConnection.authenticateFailed (C:\Users\Administrator\Desktop\Servers\theBoyzz-2.0\Master-Bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:303:26) at C:\Users\Administrator\Desktop\Servers\theBoyzz-2.0\Master-Bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:324:61 at Timeout. (C:\Users\Administrator\Desktop\Servers\theBoyzz-2.0\Master-Bot\node_modules\discord.js\src\client\BaseClient.js:83:7) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) {

This is the output, that I get after doing what you said.

galnir commented 3 years ago

Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds. at VoiceConnection.authenticateFailed (C:\Users\Administrator\Desktop\Servers\theBoyzz-2.0\Master-Bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:303:26) at C:\Users\Administrator\Desktop\Servers\theBoyzz-2.0\Master-Bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:324:61 at Timeout.<anonymous> (C:\Users\Administrator\Desktop\Servers\theBoyzz-2.0\Master-Bot\node_modules\discord.js\src\client\BaseClient.js:83:7) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) { [Symbol(code)]: 'VOICE_CONNECTION_TIMEOUT'

This is the output, that I get after doing what you said.

This error gets emitted usually as a result of a bad internet connection, is that your case?

Jaccosf commented 3 years ago

Shouldn't be possible, as I also run game servers from there.

galnir commented 3 years ago

@Jaccosf I looked this up online and the connection issue is the only thing that pops up

Jaccosf commented 3 years ago

Yeah, I hosted it from my pc and it worked. Thanks for the help, now I gotta find a place to host it :P