Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord Join Voice Channel Error -4046 EPROTO #9961

Closed
hewkawar opened this issue Nov 13, 2023 · 3 comments
Closed

Discord Join Voice Channel Error -4046 EPROTO #9961

hewkawar opened this issue Nov 13, 2023 · 3 comments

Comments

@hewkawar
Copy link

hewkawar commented Nov 13, 2023

Which package is this bug report for?

voice

Issue description

My bot its basically a music player
Step to reproduce the error:
It happen when i run /join to make my bot join follow me to voice channel

node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: write EPROTO 00090000:error:0A00042E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version:c:\ws\deps\openssl\openssl\ssl\record\rec_layer_s3.c:1600:SSL alert number 70

    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on VoiceConnection instance at:
    at VoiceConnection.onNetworkingError (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\@discordjs\voice\dist\index.js:1898:10)
    at Networking.emit (node:events:513:28)
    at Networking.onChildError (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\@discordjs\voice\dist\index.js:630:10)
    at VoiceWebSocket.emit (node:events:513:28)
    at VoiceWebSocket.ws.onerror (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\@discordjs\voice\dist\index.js:420:37)
    at callListener (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\ws\lib\event-target.js:290:14)
    at WebSocket.onError (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\ws\lib\event-target.js:230:9)
    at WebSocket.emit (node:events:513:28)
    at emitErrorAndClose (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\ws\lib\websocket.js:1016:13)
    at ClientRequest.<anonymous> (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\ws\lib\websocket.js:864:5) {
  errno: -4046,
  code: 'EPROTO',
  syscall: 'write'
}

Code sample

const { SlashCommandBuilder } = require('@discordjs/builders');
const { EmbedBuilder } = require('discord.js')
const { getVoiceConnection, joinVoiceChannel } = require('@discordjs/voice');

const lang = require('../../lang.json');
const configFile = require('../../config.json');

const config = configFile.app[configFile.appName] || configFile.app.debug;

module.exports = {
    data: new SlashCommandBuilder()
        .setName('join')
        .setDescription(lang.default.commands.join.description)
        .setDescriptionLocalizations({
            th: lang.th.commands.join.description,
        }),
    async execute(interaction) {
        const requestedLocalization = lang[interaction.locale] || lang.default;

        let connection = getVoiceConnection(interaction.guild.id);

        if (!interaction.member.voice.channel) {
            return await interaction.reply({ embeds: [new EmbedBuilder().setTitle(`:warning: ${requestedLocalization.commands.error.please_join_before_use_bot}`).setColor("Yellow")] });
        }

        if (!connection) {
            connection = joinVoiceChannel({
                channelId: interaction.member.voice.channel.id,
                guildId: interaction.guild.id,
                adapterCreator: interaction.guild.voiceAdapterCreator,
                selfDeaf: true,
                selfMute: false
            });

            await interaction.reply({ embeds: [new EmbedBuilder().setColor(config.color).setTitle(`🟢 ${requestedLocalization.commands.join.execute.success}`)]});
        } else {
            await interaction.reply({ embeds: [new EmbedBuilder().setColor(config.color).setTitle(`🟢 ${requestedLocalization.commands.join.execute.already_join}`)]});
        }

        await interaction.guild.members.me.edit({
            deaf: true,
            mute: false,
        });
    },
};

Versions

  • discord.js v.14.14.1
  • @discordjs/voice v.0.16.1
  • Node v18.13.0

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Guilds, GuildVoiceStates, GuildMessages

I have tested this issue on a development release

Bot Join my Server but it death in console

@Idris1401
Copy link
Contributor

what version are you on? both @discordjs/voice and discord.js

@hewkawar
Copy link
Author

what version are you on? both @discordjs/voice and discord.js

  • discord.js v.14.14.1
  • @discordjs/voice v.0.16.1
  • Node v18.13.0

@Idris1401
Copy link
Contributor

Idris1401 commented Nov 14, 2023

everything works fine for me

image
image

@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants