fix: improve recipient validation in ring method of GroupDMChannel
This commit is contained in:
@@ -298,8 +298,11 @@ class GroupDMChannel extends Channel {
|
|||||||
* @returns {Promise<any>}
|
* @returns {Promise<any>}
|
||||||
*/
|
*/
|
||||||
ring(recipients) {
|
ring(recipients) {
|
||||||
if (!recipients || !Array.isArray(recipients) || recipients.length == 0) recipients = null;
|
if (!recipients || !Array.isArray(recipients) || recipients.length == 0) {
|
||||||
|
recipients = null;
|
||||||
|
} else {
|
||||||
recipients = recipients.map(r => this.client.users.resolveId(r)).filter(r => r && this.recipients.get(r));
|
recipients = recipients.map(r => this.client.users.resolveId(r)).filter(r => r && this.recipients.get(r));
|
||||||
|
}
|
||||||
return this.client.api.channels(this.id).call.ring.post({
|
return this.client.api.channels(this.id).call.ring.post({
|
||||||
data: {
|
data: {
|
||||||
recipients,
|
recipients,
|
||||||
|
|||||||
Reference in New Issue
Block a user