Skip to content

Commit

Permalink
fix(gateway): remove message listener on disconnect (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidffa authored Apr 19, 2022
1 parent cb8971a commit a9b8ad4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class Shard extends EventEmitter {
}

if(this.ws.readyState !== WebSocket.CLOSED) {
this.ws.removeListener("message", this._onWSMessage);
this.ws.removeListener("close", this._onWSClose);
try {
if(options.reconnect && this.sessionID) {
Expand Down

0 comments on commit a9b8ad4

Please sign in to comment.