diff --git a/src/structures/Interaction.js b/src/structures/Interaction.js index 369c352e3ff2..82fe70881a92 100644 --- a/src/structures/Interaction.js +++ b/src/structures/Interaction.js @@ -2,6 +2,7 @@ const Base = require('./Base'); const { InteractionTypes, MessageComponentTypes } = require('../util/Constants'); +const Permissions = require('../util/Permissions'); const SnowflakeUtil = require('../util/SnowflakeUtil'); /** @@ -67,6 +68,12 @@ class Interaction extends Base { * @type {number} */ this.version = data.version; + + /** + * The permissions of the member, if one exists, in the channel this interaction was executed in + * @type {?Readonly} + */ + this.memberPermissions = data.member?.permissions ? new Permissions(data.member.permissions).freeze() : null; } /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 81409da77508..b57914a221b0 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1032,6 +1032,7 @@ export class Interaction extends Base { public type: InteractionType; public user: User; public version: number; + public memberPermissions: Readonly | null; public inGuild(): this is this & { guildId: Snowflake; member: GuildMember | APIInteractionGuildMember;