mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +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('authenticated', () => {
|
||||||
connection.once('ready', () => resolve(connection));
|
connection.once('ready', () => {
|
||||||
connection.once('error', reject);
|
resolve(connection);
|
||||||
|
connection.removeListener('error', reject);
|
||||||
|
});
|
||||||
|
connection.on('error', reject);
|
||||||
connection.once('disconnect', () => this.connections.delete(channel.guild.id));
|
connection.once('disconnect', () => this.connections.delete(channel.guild.id));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user