mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
voice: catch errors before connection is ready
This commit is contained in:
@@ -71,8 +71,11 @@ class ClientVoiceManager {
|
||||
});
|
||||
|
||||
connection.once('authenticated', () => {
|
||||
connection.once('ready', () => resolve(connection));
|
||||
connection.once('error', reject);
|
||||
connection.once('ready', () => {
|
||||
resolve(connection);
|
||||
connection.removeListener('error', reject);
|
||||
});
|
||||
connection.on('error', reject);
|
||||
connection.once('disconnect', () => this.connections.delete(channel.guild.id));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user