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

@@ -242,20 +242,16 @@ class Webhook {
/**
* Edit the webhook.
* @param {string} name The new name for the webhook
* @param {BufferResolvable} avatar The new avatar for the webhook
* @param {BufferResolvable} [avatar] The new avatar for the webhook
* @returns {Promise<Webhook>}
*/
edit(name = this.name, avatar) {
if (avatar) {
return this.client.resolver.resolveFile(avatar).then(file => {
const dataURI = this.client.resolver.resolveBase64(file);
return this.client.rest.methods.editWebhook(this, name, dataURI);
});
return this.client.resolver.resolveImage(avatar).then(data =>
this.client.rest.methods.editWebhook(this, name, data)
);
}
return this.client.rest.methods.editWebhook(this, name).then(data => {
this.setup(data);
return this;
});
return this.client.rest.methods.editWebhook(this, name);
}
/**