From 8d3797434c4db3087b7d17cfcab53973c7137368 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Mon, 19 Jun 2023 09:57:16 +0700 Subject: [PATCH] Update PartialGroupDMChannel.js #710 --- src/structures/PartialGroupDMChannel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/structures/PartialGroupDMChannel.js b/src/structures/PartialGroupDMChannel.js index 45bbff2..b48a30d 100644 --- a/src/structures/PartialGroupDMChannel.js +++ b/src/structures/PartialGroupDMChannel.js @@ -159,7 +159,8 @@ class PartialGroupDMChannel extends Channel { if (!userId) { return Promise.reject(new TypeError('User is not a User or User ID')); } - if (this.recipients.get(userId)) 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) + // API + // if (this.recipients.get(userId)) 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[userId].put(); this._recipients.push(user); return this; @@ -178,7 +179,8 @@ class PartialGroupDMChannel extends Channel { if (!user) { return Promise.reject(new TypeError('User is not a User or User ID')); } - if (!this.recipients.get(user)) return Promise.reject(new Error('USER_NOT_IN_GROUP_DM_CHANNEL')); + // API + // 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 = this._recipients.filter(r => r.id !== user); return this;