Change how GUILD_DELETE cleans up the listener
Adding `this.events[id]?.()` cleans up the listener. I removed `opts.cancel()` because with it, the event had issues firing after the first time. Resolves: #1242
This commit is contained in:
parent
184433b078
commit
f81e5f6afa
@ -190,8 +190,8 @@ async function consume(this: WebSocket, opts: EventOpts) {
|
|||||||
case "RELATIONSHIP_REMOVE":
|
case "RELATIONSHIP_REMOVE":
|
||||||
case "CHANNEL_DELETE":
|
case "CHANNEL_DELETE":
|
||||||
case "GUILD_DELETE":
|
case "GUILD_DELETE":
|
||||||
|
this.events[id]?.();
|
||||||
delete this.events[id];
|
delete this.events[id];
|
||||||
opts.cancel();
|
|
||||||
break;
|
break;
|
||||||
case "CHANNEL_CREATE":
|
case "CHANNEL_CREATE":
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user