mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
voice: catch errors before connection is ready
This commit is contained in:
parent
6b810b2331
commit
00a62a93e4
1 changed files with 5 additions and 2 deletions
|
|
@ -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));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue