Skip to content

Commit

Permalink
feat(BaseInteraction): add support for app_permissions (#8194)
Browse files Browse the repository at this point in the history
Co-authored-by: Almeida <almeidx@pm.me>
  • Loading branch information
Mateo-tem and almeidx authored Jun 29, 2022
1 parent c4653f9 commit 002d6a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/discord.js/src/structures/BaseInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<PermissionsBitField>}
*/
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<PermissionsBitField>}
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ export class BaseInteraction<Cached extends CacheType = CacheType> extends Base
public type: InteractionType;
public user: User;
public version: number;
public appPermissions: Readonly<PermissionsBitField> | null;
public memberPermissions: CacheTypeReducer<Cached, Readonly<PermissionsBitField>>;
public locale: Locale;
public guildLocale: CacheTypeReducer<Cached, Locale>;
Expand Down

0 comments on commit 002d6a5

Please sign in to comment.