mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 01:01:30 +00:00
parent
91a69fb761
commit
0008a18deb
1 changed files with 3 additions and 3 deletions
|
|
@ -81,11 +81,11 @@ class WebSocketManager extends EventEmitter {
|
||||||
this.ws = new WebSocket(gateway);
|
this.ws = new WebSocket(gateway);
|
||||||
if (browser) {
|
if (browser) {
|
||||||
this.ws.binaryType = 'arraybuffer';
|
this.ws.binaryType = 'arraybuffer';
|
||||||
this.ws.on('open', this.eventOpen.bind(this));
|
|
||||||
this.ws.on('error', this.eventError.bind(this));
|
|
||||||
} else {
|
|
||||||
this.ws.onopen = () => this.eventOpen();
|
this.ws.onopen = () => this.eventOpen();
|
||||||
this.ws.onerror = (e) => this.eventError(e);
|
this.ws.onerror = (e) => this.eventError(e);
|
||||||
|
} else {
|
||||||
|
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.onclose = (d) => this.eventClose(d);
|
||||||
this.ws.onmessage = (e) => this.eventMessage(e);
|
this.ws.onmessage = (e) => this.eventMessage(e);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue