mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +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,
|
data: defaultValue,
|
||||||
locale: defaultValue,
|
locale: defaultValue,
|
||||||
guildLocale: defaultValue,
|
guildLocale: defaultValue,
|
||||||
|
entitlements: defaultValue,
|
||||||
appPermissions: defaultValue,
|
appPermissions: defaultValue,
|
||||||
authorizingIntegrationOwners: defaultValue,
|
authorizingIntegrationOwners: defaultValue,
|
||||||
context: 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.channelId && payload.interaction.channel_id) interaction.channelId = bot.transformers.snowflake(payload.interaction.channel_id)
|
||||||
if (props.member && guildId && payload.interaction.member)
|
if (props.member && guildId && payload.interaction.member)
|
||||||
interaction.member = bot.transformers.member(bot, payload.interaction.member, guildId, user.id)
|
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) {
|
if (props.authorizingIntegrationOwners && payload.interaction.authorizing_integration_owners) {
|
||||||
interaction.authorizingIntegrationOwners = {}
|
interaction.authorizingIntegrationOwners = {}
|
||||||
|
|
||||||
|
|||||||
@@ -918,6 +918,8 @@ export interface Interaction {
|
|||||||
locale?: string
|
locale?: string
|
||||||
/** The guild's preferred locale, if invoked in a guild */
|
/** The guild's preferred locale, if invoked in a guild */
|
||||||
guildLocale?: string
|
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) */
|
/** The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites) */
|
||||||
appPermissions: bigint
|
appPermissions: bigint
|
||||||
/** Mapping of installation contexts that the interaction was authorized for to related user or guild IDs. */
|
/** Mapping of installation contexts that the interaction was authorized for to related user or guild IDs. */
|
||||||
|
|||||||
Reference in New Issue
Block a user