parent
dc6c7f1566
commit
8d3797434c
@ -159,7 +159,8 @@ class PartialGroupDMChannel extends Channel {
|
|||||||
if (!userId) {
|
if (!userId) {
|
||||||
return Promise.reject(new TypeError('User is not a User or User ID'));
|
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();
|
await this.client.api.channels[this.id].recipients[userId].put();
|
||||||
this._recipients.push(user);
|
this._recipients.push(user);
|
||||||
return this;
|
return this;
|
||||||
@ -178,7 +179,8 @@ class PartialGroupDMChannel extends Channel {
|
|||||||
if (!user) {
|
if (!user) {
|
||||||
return Promise.reject(new TypeError('User is not a User or User ID'));
|
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();
|
await this.client.api.channels[this.id].recipients[user].delete();
|
||||||
this._recipients = this._recipients.filter(r => r.id !== user);
|
this._recipients = this._recipients.filter(r => r.id !== user);
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user