diff options
Diffstat (limited to 'node_modules/discord.js/src/structures/OAuth2Application.js')
| -rw-r--r-- | node_modules/discord.js/src/structures/OAuth2Application.js | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/node_modules/discord.js/src/structures/OAuth2Application.js b/node_modules/discord.js/src/structures/OAuth2Application.js deleted file mode 100644 index 710aae8..0000000 --- a/node_modules/discord.js/src/structures/OAuth2Application.js +++ /dev/null @@ -1,157 +0,0 @@ -const Snowflake = require('../util/Snowflake'); -const Team = require('./Team'); -const util = require('util'); - -/** - * Represents an OAuth2 Application. - */ -class OAuth2Application { - constructor(client, data) { - /** - * The client that instantiated the application - * @name OAuth2Application#client - * @type {Client} - * @readonly - */ - Object.defineProperty(this, 'client', { value: client }); - - this.setup(data); - } - - setup(data) { - /** - * The ID of the app - * @type {Snowflake} - */ - this.id = data.id; - - /** - * The name of the app - * @type {string} - */ - this.name = data.name; - - /** - * The app's description - * @type {string} - */ - this.description = data.description; - - /** - * The app's icon hash - * @type {?string} - */ - this.icon = data.icon; - - /** - * The app's icon URL - * @type {string} - */ - this.iconURL = `https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`; - - /** - * The app's RPC origins - * @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; - - /** - * The flags for the app - * @type {number} - */ - this.flags = data.flags; - - /** - * OAuth2 secret for the application - * @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); - } - - /** - * The owning team of this OAuth application - * <info>In v12.0.0 this property moves to `Team#owner`.</info> - * @type {?Team} - * @deprecated - */ - this.team = data.team ? new Team(this.client, data.team) : null; - } - - /** - * The timestamp the app was created at - * @type {number} - * @readonly - */ - get createdTimestamp() { - return Snowflake.deconstruct(this.id).timestamp; - } - - /** - * The time the app was created - * @type {Date} - * @readonly - */ - get createdAt() { - return new Date(this.createdTimestamp); - } - - /** - * Reset the app's secret and bot token. - * <warn>This is only available when using a user account.</warn> - * @returns {OAuth2Application} - * @deprecated - */ - 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} - */ - toString() { - return this.name; - } -} - -OAuth2Application.prototype.reset = - util.deprecate(OAuth2Application.prototype.reset, 'OAuth2Application#reset: userbot methods will be removed'); - -module.exports = OAuth2Application; |