Add support for more OAuth features (#1203)

This commit is contained in:
Gus Caplan
2017-02-22 14:09:40 -06:00
committed by Amish Shah
parent d09dfa4c37
commit 61e12c637b
6 changed files with 67 additions and 37 deletions

View File

@@ -361,12 +361,11 @@ class Client extends EventEmitter {
/**
* Obtains the OAuth Application of the bot from Discord.
* <warn>This is only available when using a bot account.</warn>
* @param {Snowflake} [id='@me'] ID of application to fetch
* @returns {Promise<ClientOAuth2Application>}
*/
fetchApplication() {
if (!this.user.bot) throw new Error(Constants.Errors.NO_BOT_ACCOUNT);
return this.rest.methods.getMyApplication();
fetchApplication(id = '@me') {
return this.rest.methods.getApplication(id);
}
/**