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

@@ -660,7 +660,7 @@ class Guild {
/**
* Creates a new custom emoji in the guild.
* @param {BufferResolvable} attachment The image for the emoji.
* @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji.
* @param {string} name The name for the emoji.
* @returns {Promise<Emoji>} The created emoji.
* @example
@@ -676,7 +676,7 @@ class Guild {
*/
createEmoji(attachment, name) {
return new Promise(resolve => {
if (attachment.startsWith('data:')) {
if (typeof attachment === 'string' && attachment.startsWith('data:')) {
resolve(this.client.rest.methods.createEmoji(this, attachment, name));
} else {
this.client.resolver.resolveBuffer(attachment).then(data =>