Skip to content

Commit

Permalink
Merge pull request #84 from erictik/new-ws
Browse files Browse the repository at this point in the history
test
  • Loading branch information
zcpua authored Jun 4, 2023
2 parents f346032 + 0bd5c61 commit 4dc384d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ws.message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export class WsMessage {
private reconnect() {
//reconnect
this.ws = new WebSocket(this.DISCORD_GATEWAY);
this.ws.addEventListener("open", this.open.bind(this));
this.ws.on("open", this.open.bind(this));
}
// After opening ws
private async open() {
const num = this.reconnectTime.length;
this.log("open", num);
this.reconnectTime.push(false);
this.auth();
this.ws.addListener("message", this.parseMessage.bind(this));
this.ws.on("message", this.parseMessage.bind(this));
this.ws.onclose = () => {
this.reconnectTime[num] = true;
this.reconnect();
Expand Down

0 comments on commit 4dc384d

Please sign in to comment.