Backporting, doc/bug fixes as well deprecation (#1826)

* Backporting, doc/bug fixes as well deprecation

* Adress issue with not resettable icons/images
This commit is contained in:
SpaceEEC
2017-08-25 15:14:05 +02:00
committed by Crawl
parent bce5b677ad
commit 1fe201ae90
19 changed files with 125 additions and 89 deletions

View File

@@ -119,7 +119,7 @@ class GroupDMChannel extends Channel {
edit(data) {
const _data = {};
if (data.name) _data.name = data.name;
if (data.icon) _data.icon = data.icon;
if (typeof data.icon !== 'undefined') _data.icon = data.icon;
return this.client.rest.methods.updateGroupDMChannel(this, _data);
}
@@ -148,6 +148,7 @@ class GroupDMChannel extends Channel {
* Add a user to the DM
* @param {UserResolvable|string} accessTokenOrID Access token or user resolvable
* @param {string} [nick] Permanent nickname to give the user (only available if a bot is creating the DM)
* @returns {Promise<GroupDMChannel>}
*/
addUser(accessTokenOrID, nick) {
@@ -161,7 +162,7 @@ class GroupDMChannel extends Channel {
/**
* Set a new GroupDMChannel icon.
* @param {Base64Resolvable|BufferResolvable} icon The new icon of the group dm
* @returns {Promise<Guild>}
* @returns {Promise<GroupDMChannel>}
* @example
* // Edit the group dm icon
* channel.setIcon('./icon.png')
@@ -172,6 +173,25 @@ class GroupDMChannel extends Channel {
return this.client.resolver.resolveImage(icon).then(data => this.edit({ icon: data }));
}
/**
* Sets a new name for this Group DM.
* @param {string} name New name for this Group DM
* @returns {Promise<GroupDMChannel>}
*/
setName(name) {
return this.edit({ name });
}
/**
* Removes an user from this Group DM.
* @param {UserResolvable} user User to remove
* @returns {Promise<GroupDMChannel>}
*/
removeUser(user) {
const id = this.client.resolver.resolveUserID(user);
return this.client.rest.methods.removeUserFromGroupDM(this, id);
}
/**
* When concatenated with a string, this automatically concatenates the channel's name instead of the Channel object.
* @returns {string}
@@ -203,6 +223,7 @@ class GroupDMChannel extends Channel {
get typing() {}
get typingCount() {}
createCollector() {}
createMessageCollector() {}
awaitMessages() {}
// Doesn't work on Group DMs; bulkDelete() {}
acknowledge() {}