From b481d0a96e82d4197ed99336753c0310283d53a8 Mon Sep 17 00:00:00 2001 From: Fleny Date: Wed, 29 Jul 2026 07:51:22 +0200 Subject: [PATCH] feat: add app_permissions to channel resolved data (#5185) --- packages/bot/src/desiredProperties.ts | 1 + packages/bot/src/transformers/channel.ts | 1 + packages/bot/src/transformers/types.ts | 2 ++ packages/types/src/discord/channel.ts | 11 ++++++++++- packages/types/src/discord/interactions.ts | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/bot/src/desiredProperties.ts b/packages/bot/src/desiredProperties.ts index 11af415f9..2958b4b15 100644 --- a/packages/bot/src/desiredProperties.ts +++ b/packages/bot/src/desiredProperties.ts @@ -294,6 +294,7 @@ export function createDesiredPropertiesObject packOverwrites(o.allow ?? '0', o.deny ?? '0', o.id, o.type)); diff --git a/packages/bot/src/transformers/types.ts b/packages/bot/src/transformers/types.ts index 3151138c1..c790ee2be 100644 --- a/packages/bot/src/transformers/types.ts +++ b/packages/bot/src/transformers/types.ts @@ -503,6 +503,8 @@ export interface Channel { defaultAutoArchiveDuration?: number; /** computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on an interaction. This does not include implicit permissions, which may need to be checked separately. */ permissions?: Permissions; + /**computed permissions for the bot user in the channel, including overwrites, only included when part of the resolved data received on an interaction. This does not include implicit permissions, which may need to be checked separately */ + appPermissions?: Permissions; /** The flags of the channel */ flags?: number; /** diff --git a/packages/types/src/discord/channel.ts b/packages/types/src/discord/channel.ts index 65f9289c6..6a266bb34 100644 --- a/packages/types/src/discord/channel.ts +++ b/packages/types/src/discord/channel.ts @@ -106,11 +106,20 @@ export interface DiscordChannel extends Partial { * Computed permissions for the invoking user in the channel. * * @remarks - * The computed permissions include channel overwrites but does not include implicit permissions, those need to be checked separatly. + * This does not include implicit permissions, which may need to be checked separately * * Only presented when part of `resolved` data received on an interaction. */ permissions?: string; + /** + * computed permissions for the bot user in the channel, including overwrites. + * + * @remarks + * This does not include implicit permissions, which may need to be checked separately + * + * Only included when part of the `resolved` data received on an interaction. + */ + app_permissions?: string; /** The flags of the channel */ flags?: ChannelFlags; /** number of messages ever sent in a thread, it's similar to `message_count` on message creation, but will not decrement the number when a message is deleted */ diff --git a/packages/types/src/discord/interactions.ts b/packages/types/src/discord/interactions.ts index d99c57416..da23166df 100644 --- a/packages/types/src/discord/interactions.ts +++ b/packages/types/src/discord/interactions.ts @@ -156,6 +156,7 @@ export interface DiscordInteractionDataResolved { | 'name' | 'type' | 'permissions' + | 'app_permissions' | 'last_message_id' | 'last_pin_timestamp' | 'nsfw'