Discord.js: Error when trying to connect to voice channel

Created on 10 Feb 2019  Â·  7Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
Error when trying to connect to voice channel, authentication failed

Include a reproducible code sample here, if possible:
const connection = message.member.voiceChannel.join()


(node:23368) UnhandledPromiseRejectionWarning: Error: Error: Connection not established within 15 seconds.
    at VoiceConnection.authenticateFailed (C:\Users\terra\Desktop\DiscordBot\node_modules\discord.js\src\client\voice\VoiceConnection.js:256:27)
    at connectTimeout.client.setTimeout (C:\Users\terra\Desktop\DiscordBot\node_modules\discord.js\src\client\voice\VoiceConnection.js:285:18)
    at Timeout.setTimeout (C:\Users\terra\Desktop\DiscordBot\node_modules\discord.js\src\client\Client.js:433:7)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
(node:23368) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23368) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Further details:

  • discord.js version: ^11.4.2
  • Node.js version: v8.11.3
  • Operating system: Windows 10
  • [x] I have also tested the issue on latest master, commit hash

I have FFMPEG installed, node-opus, opusscript, everything works fine but when i try to connect to voice channel it throws an error

Full code:

    youTube.search(args.join(" "), 1, function(error, result) {
      let id = result.items[0].id.videoId;
      let link = "https://www.youtube.com/watch?v=" + id;
      const connection = message.member.voiceChannel.join().then(connection => {
          const stream = ytdl(link, { filter: 'audioonly' });
          const dispatcher = connection.playStream(stream, streamOptions);
          dispatcher.on('end', () => {
              dispatcher.destroy();
          });
      });
    });

EDIT:
Tried it on master, still get an error, but its slightly different
UnhandledPromiseRejectionWarning: Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.

unverified voice bug

Most helpful comment

Just FYI, you have stable, to install master you do npm i discordjs/discord.js. It has a lot of bugfixes overall, including music.

If you can't install it, make sure you have git installed.

All 7 comments

This might be related to #3005
Can you check whether the bot has permissions to actually connect? (Specifically has VIEW_CHANNEL)

This might be related to #3005
Can you check whether the bot has permissions to actually connect? (Specifically has VIEW_CHANNEL)

Yeah, even after i enabled them it doesnt work
image

Just FYI, you have stable, to install master you do npm i discordjs/discord.js. It has a lot of bugfixes overall, including music.

If you can't install it, make sure you have git installed.

Everything is in GuildMember#voice, please go to the Discord server for more information.

Just FYI, you have stable, to install master you do npm i discordjs/discord.js. It has a lot of bugfixes overall, including music.

If you can't install it, make sure you have git installed.

See edit

Could you update to the latest commit (https://github.com/discordjs/discord.js/commit/aab3523fb5b60d21d20cbf2be01c32bdf21aa8ae) and try the following to produce some more debug information:

client.on('debug', console.log);

You should see output something like this:
image

If you could try this again and send me the full output from this log -- this will contain sensitive information so I'd recommend messaging me on Discord at hydrabolt#0001. However, you should still be ok to post the details here on GitHub if you remove your IP address from the logs and partially redact any IDs.

Actually, this issue is a duplicate of #2979 so I'm going to close this, if you have any more information -- especially debug information as described as above -- please message me on Discord or on the other issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shukriadams picture shukriadams  Â·  3Comments

LLamaFTL picture LLamaFTL  Â·  3Comments

BrandonCookeDev picture BrandonCookeDev  Â·  3Comments

iCrawl picture iCrawl  Â·  3Comments

tiritto picture tiritto  Â·  3Comments