mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Add support for more OAuth features (#1203)
This commit is contained in:
@@ -47,9 +47,51 @@ class OAuth2Application {
|
||||
|
||||
/**
|
||||
* The app's RPC origins
|
||||
* @type {Array<string>}
|
||||
* @type {?string[]}
|
||||
*/
|
||||
this.rpcOrigins = data.rpc_origins;
|
||||
|
||||
/**
|
||||
* The app's redirect URIs
|
||||
* @type {string[]}
|
||||
*/
|
||||
this.redirectURIs = data.redirect_uris;
|
||||
|
||||
/**
|
||||
* If this app's bot requires a code grant when using the oauth2 flow
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.botRequireCodeGrant = data.bot_require_code_grant;
|
||||
|
||||
/**
|
||||
* If this app's bot is public
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.botPublic = data.bot_public;
|
||||
|
||||
/**
|
||||
* If this app can use rpc
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.rpcApplicationState = data.rpc_application_state;
|
||||
|
||||
/**
|
||||
* Object containing basic info about this app's bot
|
||||
* @type {Object}
|
||||
*/
|
||||
this.bot = data.bot;
|
||||
|
||||
/**
|
||||
* Flags for the app
|
||||
* @type {number}
|
||||
*/
|
||||
this.flags = data.flags;
|
||||
|
||||
/**
|
||||
* oauth2 secret for the app
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.secret = data.secret;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +112,14 @@ class OAuth2Application {
|
||||
return new Date(this.createdTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the app's secret and bot token
|
||||
* @returns {OAuth2Application}
|
||||
*/
|
||||
reset() {
|
||||
return this.client.rest.methods.resetApplication(this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically concatenates the app name rather than the app object.
|
||||
* @returns {string}
|
||||
|
||||
Reference in New Issue
Block a user