From c75a5e3b044468ac63f0879a73df78bc10be337a Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sat, 17 Jun 2023 23:17:40 +0700 Subject: [PATCH] fix #710 --- src/structures/PartialGroupDMChannel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/PartialGroupDMChannel.js b/src/structures/PartialGroupDMChannel.js index b638ae9..babd470 100644 --- a/src/structures/PartialGroupDMChannel.js +++ b/src/structures/PartialGroupDMChannel.js @@ -160,7 +160,7 @@ class PartialGroupDMChannel extends Channel { } if (this.recipients.get(user)) return Promise.reject(new Error('USER_ALREADY_IN_GROUP_DM_CHANNEL')); // Fails sometimes if member leaves recently (ex. user leave msg's channel used for adding) await this.client.api.channels[this.id].recipients[user].put(); - this.recipients.set(user, this.client.users.cache.get(user)); + this._recipients = this._recipients.filter(r => r.id !== user); return this; } @@ -179,7 +179,7 @@ class PartialGroupDMChannel extends Channel { } if (!this.recipients.get(user)) return Promise.reject(new Error('USER_NOT_IN_GROUP_DM_CHANNEL')); await this.client.api.channels[this.id].recipients[user].delete(); - this.recipients.delete(user); + this._recipients = this._recipients.filter(r => r.id !== user); return this; }