mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
Remove old uws-specific code (0.11.1 has the good stuff)
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
"pako": "^1.0.3",
|
"pako": "^1.0.3",
|
||||||
"superagent": "^3.0.0",
|
"superagent": "^3.0.0",
|
||||||
"tweetnacl": "^0.14.3",
|
"tweetnacl": "^0.14.3",
|
||||||
"uws": "^0.11.0"
|
"uws": "^0.11.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"node-opus": "^0.2.0",
|
"node-opus": "^0.2.0",
|
||||||
|
|||||||
@@ -72,15 +72,10 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
* @type {WebSocket}
|
* @type {WebSocket}
|
||||||
*/
|
*/
|
||||||
this.ws = new WebSocket(`wss://${this.voiceConnection.authentication.endpoint}`);
|
this.ws = new WebSocket(`wss://${this.voiceConnection.authentication.endpoint}`);
|
||||||
if (typeof window !== 'undefined') {
|
this.ws.onopen = this.onOpen.bind(this);
|
||||||
this.ws.onopen = this.onOpen.bind(this);
|
|
||||||
this.ws.onerror = this.onError.bind(this);
|
|
||||||
} else {
|
|
||||||
this.ws.on('open', this.onOpen.bind(this));
|
|
||||||
this.ws.on('error', this.onError.bind(this));
|
|
||||||
}
|
|
||||||
this.ws.onmessage = this.onMessage.bind(this);
|
this.ws.onmessage = this.onMessage.bind(this);
|
||||||
this.ws.onclose = this.onClose.bind(this);
|
this.ws.onclose = this.onClose.bind(this);
|
||||||
|
this.ws.onerror = this.onError.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,16 +79,11 @@ class WebSocketManager extends EventEmitter {
|
|||||||
this.normalReady = false;
|
this.normalReady = false;
|
||||||
if (this.status !== Constants.Status.RECONNECTING) this.status = Constants.Status.CONNECTING;
|
if (this.status !== Constants.Status.RECONNECTING) this.status = Constants.Status.CONNECTING;
|
||||||
this.ws = new WebSocket(gateway);
|
this.ws = new WebSocket(gateway);
|
||||||
if (browser) {
|
if (browser) this.ws.binaryType = 'arraybuffer';
|
||||||
this.ws.binaryType = 'arraybuffer';
|
this.ws.onopen = this.eventOpen.bind(this);
|
||||||
this.ws.onopen = () => this.eventOpen();
|
this.ws.onmessage = this.eventMessage.bind(this);
|
||||||
this.ws.onerror = (e) => this.eventError(e);
|
this.ws.onclose = this.eventClose.bind(this);
|
||||||
} else {
|
this.ws.onerror = this.eventError.bind(this);
|
||||||
this.ws.on('open', this.eventOpen.bind(this));
|
|
||||||
this.ws.on('error', this.eventError.bind(this));
|
|
||||||
}
|
|
||||||
this.ws.onclose = (d) => this.eventClose(d);
|
|
||||||
this.ws.onmessage = (e) => this.eventMessage(e);
|
|
||||||
this._queue = [];
|
this._queue = [];
|
||||||
this._remaining = 3;
|
this._remaining = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user