diff --git a/src/structures/ClientApplication.js b/src/structures/ClientApplication.js index b08648bdc..7ea360200 100644 --- a/src/structures/ClientApplication.js +++ b/src/structures/ClientApplication.js @@ -47,27 +47,27 @@ class ClientApplication extends Base { /** * The app's RPC origins, if enabled - * @type {?string[]} + * @type {string[]} */ this.rpcOrigins = data.rpc_origins || []; /** * If this app's bot requires a code grant when using the OAuth2 flow - * @type {boolean} + * @type {?boolean} */ - this.botRequireCodeGrant = data.bot_require_code_grant; + this.botRequireCodeGrant = typeof data.bot_require_code_grant !== 'undefined' ? data.bot_require_code_grant : null; /** * If this app's bot is public - * @type {boolean} + * @type {?boolean} */ - this.botPublic = data.bot_public; + this.botPublic = typeof data.bot_public !== 'undefined' ? data.bot_public : null; /** * The owner of this OAuth application - * @type {User} + * @type {?User} */ - this.owner = this.client.users.add(data.owner); + this.owner = data.owner ? this.client.users.add(data.owner) : null; } /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 449c8077d..a0d4ec83d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -228,8 +228,8 @@ declare module 'discord.js' { export class ClientApplication extends Base { constructor(client: Client, data: object); - public botPublic: boolean; - public botRequireCodeGrant: boolean; + public botPublic?: boolean; + public botRequireCodeGrant?: boolean; public cover?: string; public readonly createdAt: Date; public readonly createdTimestamp: number; @@ -237,7 +237,7 @@ declare module 'discord.js' { public icon: string; public id: Snowflake; public name: string; - public owner: User; + public owner?: User; public rpcOrigins: string[]; public coverImage(options?: AvatarOptions): string; public fetchAssets(): Promise;