From 8e5c6002275d6ce6c370b5213af6a14649050763 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sun, 30 Apr 2017 11:21:48 +0100 Subject: [PATCH] Make OAuth2Application backwards compatible again --- src/client/Client.js | 2 +- src/structures/OAuth2Application.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/Client.js b/src/client/Client.js index 98641abde..861becb2c 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -382,7 +382,7 @@ class Client extends EventEmitter { /** * Obtains the OAuth Application of the bot from Discord. * @param {Snowflake} [id='@me'] ID of application to fetch - * @returns {Promise} + * @returns {Promise} */ fetchApplication(id = '@me') { return this.rest.methods.getApplication(id); diff --git a/src/structures/OAuth2Application.js b/src/structures/OAuth2Application.js index 8a7a0ec48..0e037ab7d 100644 --- a/src/structures/OAuth2Application.js +++ b/src/structures/OAuth2Application.js @@ -94,6 +94,14 @@ class OAuth2Application { * @type {boolean} */ this.secret = data.secret; + + if (data.owner) { + /** + * The owner of this OAuth application + * @type {?User} + */ + this.owner = this.client.dataManager.newUser(data.owner); + } } /**