From 002d6a5aede3d1c0e08bd58eeef38a3b9202f525 Mon Sep 17 00:00:00 2001 From: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:36:32 -0500 Subject: [PATCH] feat(BaseInteraction): add support for `app_permissions` (#8194) Co-authored-by: Almeida --- packages/discord.js/src/structures/BaseInteraction.js | 6 ++++++ packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/packages/discord.js/src/structures/BaseInteraction.js b/packages/discord.js/src/structures/BaseInteraction.js index 1bdd1443177e..1f8b00bcaee3 100644 --- a/packages/discord.js/src/structures/BaseInteraction.js +++ b/packages/discord.js/src/structures/BaseInteraction.js @@ -70,6 +70,12 @@ class BaseInteraction extends Base { */ this.version = data.version; + /** + * Set of permissions the application or bot has within the channel the interaction was sent from + * @type {?Readonly} + */ + this.appPermissions = data.app_permissions ? new PermissionsBitField(data.app_permissions).freeze() : null; + /** * The permissions of the member, if one exists, in the channel this interaction was executed in * @type {?Readonly} diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 3d7cafe23587..2e2eb0ea935a 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1518,6 +1518,7 @@ export class BaseInteraction extends Base public type: InteractionType; public user: User; public version: number; + public appPermissions: Readonly | null; public memberPermissions: CacheTypeReducer>; public locale: Locale; public guildLocale: CacheTypeReducer;