From 17dc876a9e5502d673fff43eaf2ed2a068becb0a Mon Sep 17 00:00:00 2001 From: Fleny Date: Fri, 23 May 2025 23:54:21 +0200 Subject: [PATCH] fix(bot): Add entitlements to interactions (#4198) * Add entitlements to interactions * fix type error --- packages/bot/src/desiredProperties.ts | 1 + packages/bot/src/transformers/interaction.ts | 2 ++ packages/bot/src/transformers/types.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/packages/bot/src/desiredProperties.ts b/packages/bot/src/desiredProperties.ts index dd4a67df4..a2f30136b 100644 --- a/packages/bot/src/desiredProperties.ts +++ b/packages/bot/src/desiredProperties.ts @@ -418,6 +418,7 @@ export function createDesiredPropertiesObject bot.transformers.entitlement(bot, e)) if (props.authorizingIntegrationOwners && payload.interaction.authorizing_integration_owners) { interaction.authorizingIntegrationOwners = {} diff --git a/packages/bot/src/transformers/types.ts b/packages/bot/src/transformers/types.ts index db83fe503..0a35228a6 100644 --- a/packages/bot/src/transformers/types.ts +++ b/packages/bot/src/transformers/types.ts @@ -918,6 +918,8 @@ export interface Interaction { locale?: string /** The guild's preferred locale, if invoked in a guild */ guildLocale?: string + /** For monetized apps, any entitlements for the invoking user, representing access to premium SKUs */ + entitlements: Entitlement[] /** The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites) */ appPermissions: bigint /** Mapping of installation contexts that the interaction was authorized for to related user or guild IDs. */