mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Fixed ClientUser#createGroupDM on user accounts and added some more GroupDMChannel stuff (#1747)
* ClientUser#createGroupDM now works like the docs states on user accounts * Added GroupDMChannel#setIcon and fixed null handling for the channel name * Added an s * Don't resolve when icon is falsy and removed useless name trimming * Removed now unnecessary name constant * vscode being great * Added GroupDMChannel#iconURL
This commit is contained in:
@@ -345,7 +345,6 @@ class ClientUser extends User {
|
||||
* An object containing either a user or access token, and an optional nickname.
|
||||
* @typedef {Object} GroupDMRecipientOptions
|
||||
* @property {UserResolvable} [user] User to add to the Group DM
|
||||
* (only available if a user is creating the DM)
|
||||
* @property {string} [accessToken] Access token to use to add a user to the Group DM
|
||||
* (only available if a bot is creating the DM)
|
||||
* @property {string} [nick] Permanent nickname (only available if a bot is creating the DM)
|
||||
@@ -365,7 +364,7 @@ class ClientUser extends User {
|
||||
if (r.nick) o[r.user ? r.user.id : r.id] = r.nick;
|
||||
return o;
|
||||
}, {}),
|
||||
} : { recipients: recipients.map(u => this.client.resolver.resolveUserID(u)) };
|
||||
} : { recipients: recipients.map(u => this.client.resolver.resolveUserID(u.user || u.id)) };
|
||||
return this.client.api.users('@me').channels.post({ data })
|
||||
.then(res => new GroupDMChannel(this.client, res));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user