mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
fix(bot): Add entitlements to interactions (#4198)
* Add entitlements to interactions * fix type error
This commit is contained in:
@@ -418,6 +418,7 @@ export function createDesiredPropertiesObject<T extends RecursivePartial<Transfo
|
||||
data: defaultValue,
|
||||
locale: defaultValue,
|
||||
guildLocale: defaultValue,
|
||||
entitlements: defaultValue,
|
||||
appPermissions: defaultValue,
|
||||
authorizingIntegrationOwners: defaultValue,
|
||||
context: defaultValue,
|
||||
|
||||
@@ -148,6 +148,8 @@ export function transformInteraction(
|
||||
if (props.channelId && payload.interaction.channel_id) interaction.channelId = bot.transformers.snowflake(payload.interaction.channel_id)
|
||||
if (props.member && guildId && payload.interaction.member)
|
||||
interaction.member = bot.transformers.member(bot, payload.interaction.member, guildId, user.id)
|
||||
if (props.entitlements && payload.interaction.entitlements)
|
||||
interaction.entitlements = payload.interaction.entitlements.map((e) => bot.transformers.entitlement(bot, e))
|
||||
if (props.authorizingIntegrationOwners && payload.interaction.authorizing_integration_owners) {
|
||||
interaction.authorizingIntegrationOwners = {}
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user