From 234648bd2a438038bc52cc2f58ff70bdb1b02288 Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Fri, 2 Feb 2018 11:41:08 -0600 Subject: [PATCH] fix(ClientApplication): createAsset incorrectly resolving image and posting --- src/structures/ClientApplication.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/structures/ClientApplication.js b/src/structures/ClientApplication.js index 749f635ed..8c968b0da 100644 --- a/src/structures/ClientApplication.js +++ b/src/structures/ClientApplication.js @@ -166,13 +166,12 @@ class ClientApplication extends Base { * @param {string} type Type of the asset. `big`, or `small` * @returns {Promise} */ - createAsset(name, data, type) { - return DataResolver.resolveBase64(data).then(b64 => - this.client.api.oauth2.applications(this.id).assets.post({ data: { - name, - data: b64, - type: ClientApplicationAssetTypes[type.toUpperCase()], - } })); + async createAsset(name, data, type) { + return this.client.api.oauth2.applications(this.id).assets.post({ data: { + name, + type: ClientApplicationAssetTypes[type.toUpperCase()], + image: await DataResolver.resolveImage(data), + } }); } /**