mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
Allow await endpoint stage to not error (#1444)
This commit is contained in:
parent
fccd0bd183
commit
2bf8a36077
1 changed files with 6 additions and 5 deletions
|
|
@ -169,19 +169,20 @@ class VoiceConnection extends EventEmitter {
|
|||
* @returns {void}
|
||||
*/
|
||||
setTokenAndEndpoint(token, endpoint) {
|
||||
if (!token) {
|
||||
this.authenticateFailed('Token not provided from voice server packet.');
|
||||
if (!endpoint) {
|
||||
// Signifies awaiting endpoint stage
|
||||
return;
|
||||
}
|
||||
if (!endpoint) {
|
||||
this.authenticateFailed('Endpoint not provided from voice server packet.');
|
||||
|
||||
if (!token) {
|
||||
this.authenticateFailed('Token not provided from voice server packet.');
|
||||
return;
|
||||
}
|
||||
|
||||
endpoint = endpoint.match(/([^:]*)/)[0];
|
||||
|
||||
if (!endpoint) {
|
||||
this.authenticateFailed('Failed to find an endpoint.');
|
||||
this.authenticateFailed('Invalid endpoint received.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue