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:
SpaceEEC
2017-08-04 09:17:46 +02:00
committed by Crawl
parent a30fc87816
commit abfda7c3cc
3 changed files with 36 additions and 3 deletions

View File

@@ -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));
}