mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
Allow await endpoint stage to not error (#1444)
This commit is contained in:
@@ -169,19 +169,20 @@ class VoiceConnection extends EventEmitter {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
setTokenAndEndpoint(token, endpoint) {
|
setTokenAndEndpoint(token, endpoint) {
|
||||||
if (!token) {
|
if (!endpoint) {
|
||||||
this.authenticateFailed('Token not provided from voice server packet.');
|
// Signifies awaiting endpoint stage
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!endpoint) {
|
|
||||||
this.authenticateFailed('Endpoint not provided from voice server packet.');
|
if (!token) {
|
||||||
|
this.authenticateFailed('Token not provided from voice server packet.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoint = endpoint.match(/([^:]*)/)[0];
|
endpoint = endpoint.match(/([^:]*)/)[0];
|
||||||
|
|
||||||
if (!endpoint) {
|
if (!endpoint) {
|
||||||
this.authenticateFailed('Failed to find an endpoint.');
|
this.authenticateFailed('Invalid endpoint received.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user