-
Hi! |
Beta Was this translation helpful? Give feedback.
Answered by
002-sans
Aug 19, 2023
Replies: 1 comment 2 replies
-
with a small modification of the module, I see it's possible to create a group with only me. Dir: - BEFORE
async createGroupDM(recipients) {
// Check
if (!Array.isArray(recipients)) throw new Error(`Expected an array of recipients (got ${typeof recipients})`);
recipients = recipients
.map(r => this.client.users.resolveId(r))
.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)');
const data = await this.client.api.users['@me'].channels.post({
data: { recipients },
});
return this._add(data, null, { cache: true, allowUnknownGuild: true });
}
}
+ AFTER
async createGroupDM(recipients) {
// Check
if (!Array.isArray(recipients)) throw new Error(`Expected an array of recipients (got ${typeof recipients})`);
recipients = recipients
.map(r => this.client.users.resolveId(r))
.filter(r => r && this.client.relationships.cache.get(r) == RelationshipTypes.FRIEND);
if (recipients.length > 9) throw new Error('Invalid Users length (2 - 9)');
const data = await this.client.api.users['@me'].channels.post({
data: { recipients },
});
return this._add(data, null, { cache: true, allowUnknownGuild: true });
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
002-sans
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
with a small modification of the module, I see it's possible to create a group with only me.
Dir:
./src/managers/ChannelManager.js
- BEFORE async createGroupDM(recipients) { // Check if (!Array.isArray(recipients)) throw new Error(`Expected an array of recipients (got ${typeof recipients})`); recipients = recipients .map(r => this.client.users.resolveId(r)) .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)'); const data…