Webpack build for branch master: 7f921883f4

This commit is contained in:
Travis CI 2017-08-31 15:01:45 +00:00
parent e12625bfd6
commit b3c65b8f51
2 changed files with 7 additions and 8 deletions

View file

@ -13729,15 +13729,14 @@ class TextChannel extends GuildChannel {
* .then(webhook => console.log(`Created webhook ${webhook}`)) * .then(webhook => console.log(`Created webhook ${webhook}`))
* .catch(console.error) * .catch(console.error)
*/ */
createWebhook(name, { avatar, reason } = {}) { async createWebhook(name, { avatar, reason } = {}) {
if (typeof avatar === 'string' && avatar.startsWith('data:')) { if (typeof avatar === 'string' && !avatar.startsWith('data:')) {
avatar = await this.client.resolver.resolveImage(avatar);
}
return this.client.api.channels[this.id].webhooks.post({ data: { return this.client.api.channels[this.id].webhooks.post({ data: {
name, avatar, name, avatar,
}, reason }).then(data => new Webhook(this.client, data)); }, reason }).then(data => new Webhook(this.client, data));
} }
return this.client.resolver.resolveImage(avatar).then(image =>
this.createWebhook(name, { avatar: image, reason }));
}
// These are here only for documentation purposes - they are implemented by TextBasedChannel // These are here only for documentation purposes - they are implemented by TextBasedChannel
/* eslint-disable no-empty-function */ /* eslint-disable no-empty-function */

File diff suppressed because one or more lines are too long