My bot successfully connects to channels, then tries to await entersState(connection, VoiceConnectionStatus.Ready, 15e3); but for some channels it enters to the Ready state successfully while for others the following error is got:
AbortError: The operation was aborted at EventTarget.abortListener (node:events:993:14) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:741:20) at EventTarget.dispatchEvent (node:internal/event_target:683:26) at abortSignal (node:internal/abort_controller:368:10) at AbortController.abort (node:internal/abort_controller:402:5) at Timeout.<anonymous> (/home/cmp-name/my-app/node_modules/@discordjs/voice/dist/index.js:2504:39) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7)
My code: export async function join(channel: VoiceBasedChannel) { const connection = joinVoiceChannel({ channelId: channel.id, guildId: channel.guild.id, selfDeaf: false, selfMute: true, adapterCreator: channel.guild.voiceAdapterCreator as unknown as DiscordGatewayAdapterCreator, debug: true });
connection.setMaxListeners(100);
connection.on('debug', (message) => { log.debug(
Debug message for the ${channel.guild.id} guild: ${message}
Debug message for the ${channel.guild.id} guild: ${message}
); });
connection.on('error', (error) => { log.error(
Error for the ${channel.guild.id} guild: ${error}
Error for the ${channel.guild.id} guild: ${error}
); });
log.debug(
Connection to the ${channel.guild.id}[${channel.id}] voice channel was created successfully
Connection to the ${channel.guild.id}[${channel.id}] voice channel was created successfully