Update ChannelManager.js

This commit is contained in:
Shinetsu_Ruwin
2024-07-27 16:19:04 +02:00
committed by GitHub
parent 65c5332eed
commit 7d3ef6afcd

View File

@@ -127,7 +127,7 @@ class ChannelManager extends CachedManager {
recipients = recipients recipients = recipients
.map(r => this.client.users.resolveId(r)) .map(r => this.client.users.resolveId(r))
.filter(r => r && this.client.relationships.cache.get(r) == RelationshipTypes.FRIEND); .filter(r => r && this.client.relationships.cache.get(r) == RelationshipTypes.FRIEND);
if (recipients.length < 2 || recipients.length > 9) throw new Error('Invalid Users length (2 - 9)'); if (recipients.length <= 0 || recipients.length > 9) throw new Error('Invalid Users length (1 - 9)');
const data = await this.client.api.users['@me'].channels.post({ const data = await this.client.api.users['@me'].channels.post({
data: { recipients }, data: { recipients },
}); });