Update ChannelManager.js

This commit is contained in:
Sans
2024-08-22 22:17:36 +02:00
committed by GitHub
parent 96fd943153
commit a168858aaf

View File

@@ -128,7 +128,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 < 1 || recipients.length > 9) throw new Error('Invalid Users length (max=9)'); if (recipients.length == 1 || recipients.length > 9) throw new Error('Invalid Users length (max=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 },
}); });