语音通道错误? “错误:15秒内未建立连接。”

时间:2019-06-02 05:51:45

标签: javascript discord discord.js

当我的不和谐机器人加入语音通道后,便离开了。几分钟后,僵尸程序崩溃并显示“错误:15秒内未建立连接。”

我尝试更新discord.js,但无法正常工作。重新启动,什么都没有。我不认为这是我的机器人,但也许是不和谐的错?我现在只是猜测。

这是我加入VC的代码:

    voiceChannel.join().then(connection => {
        currentStream = connection.playStream(ytdl(
            args[0],
            { filter: 'audioonly' }
        )).catch (err => {
            channelmsg.send(`I was unable to do this command, make sure I have permission to do this. \`ERR: 0xP00002\``)
            return
        });
    });

这是我离开VC的代码:

                        if (voiceChannel) {
                            voiceChannel.leave();
                            var embed = new Discord.RichEmbed()
                                .setColor(0xff0000)
                                .addField('**:play_pause: Music Command.**', `I have now left the voice channel. :wave:`)
                            channelmsg.send({embed});

语音通道也只是message.member.voiceChannel;

这是机器人离开VC时遇到的错误...

      throw er; // Unhandled 'error' event
      ^

Error: Error: Connection not established within 15 seconds.
    at VoiceConnection.authenticateFailed (/srv/samba/share/(bot_name)/node_modules/discord.js/src/client/voice/VoiceConnection.js:263:26)
    at connectTimeout.client.setTimeout (/srv/samba/share/(bot_name)/node_modules/discord.js/src/client/voice/VoiceConnection.js:285:18)
    at Timeout.setTimeout (/srv/samba/share/(bot_name)/node_modules/discord.js/src/client/Client.js:434:7)
    at listOnTimeout (internal/timers.js:535:17)
    at processTimers (internal/timers.js:479:7)
Emitted 'error' event at:
    at VoiceConnection.authenticateFailed (/srv/samba/share/(bot_name)/node_modules/discord.js/src/client/voice/VoiceConnection.js:263:12)
    at connectTimeout.client.setTimeout (/srv/samba/share/(bot_name)/node_modules/discord.js/src/client/voice/VoiceConnection.js:285:18)
    [... lines matching original stack trace ...]
    at processTimers (internal/timers.js:479:7)

如果任何人都知道如何解决它,或者已知可以解决此问题的discord.js的新版本,请在评论中告诉我。

谢谢! -ktg

0 个答案:

没有答案