Fantastic PR #368 by Gus (#921)

This commit is contained in:
Gus Caplan
2016-11-23 21:16:19 -06:00
committed by Schuyler Cebulskie
parent 91a69fb761
commit 0008a18deb

View File

@@ -81,11 +81,11 @@ class WebSocketManager extends EventEmitter {
this.ws = new WebSocket(gateway);
if (browser) {
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.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.onmessage = (e) => this.eventMessage(e);