Fix other BufferResolvables with base64

This commit is contained in:
Schuyler Cebulskie
2016-12-30 16:22:29 -05:00
parent 2ea744c9d1
commit 4447e367f6
3 changed files with 5 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ class TextChannel extends GuildChannel {
/**
* Create a webhook for the channel.
* @param {string} name The name of the webhook.
* @param {BufferResolvable} avatar The avatar for the webhook.
* @param {BufferResolvable|Base64Resolvable} avatar The avatar for the webhook.
* @returns {Promise<Webhook>} webhook The created webhook.
* @example
* channel.createWebhook('Snek', 'http://snek.s3.amazonaws.com/topSnek.png')
@@ -62,7 +62,7 @@ class TextChannel extends GuildChannel {
*/
createWebhook(name, avatar) {
return new Promise(resolve => {
if (avatar.startsWith('data:')) {
if (typeof avatar === 'string' && avatar.startsWith('data:')) {
resolve(this.client.rest.methods.createWebhook(this, name, avatar));
} else {
this.client.resolver.resolveBuffer(avatar).then(data =>