From 35133a157524c588d5b7625022260ba118a00c10 Mon Sep 17 00:00:00 2001 From: Fleny Date: Tue, 16 Sep 2025 21:26:50 +0200 Subject: [PATCH] api-docs: Fix some stuff in interactions (#4457) * api-docs: Fix some stuff in interactions * Apply and fix code review suggestions --------- Co-authored-by: Awesome Stickz --- packages/bot/src/commandOptionsParser.ts | 36 ++++++++++++++++++++-- packages/types/src/discord/interactions.ts | 25 +++++++++++++-- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/packages/bot/src/commandOptionsParser.ts b/packages/bot/src/commandOptionsParser.ts index 9a30baa93..a902b1b3e 100644 --- a/packages/bot/src/commandOptionsParser.ts +++ b/packages/bot/src/commandOptionsParser.ts @@ -75,7 +75,23 @@ export interface InteractionResolvedDataUser = Pick< SetupDesiredProps, - Extract, 'id' | 'name' | 'type' | 'permissions' | 'threadMetadata' | 'parentId'> + Extract< + keyof SetupDesiredProps, + | 'id' + | 'name' + | 'type' + | 'permissions' + | 'lastMessageId' + | 'lastPinTimestamp' + | 'nsfw' + | 'parentId' + | 'guildId' + | 'flags' + | 'rateLimitPerUser' + | 'topic' + | 'position' + | 'threadMetadata' + > > export type InteractionResolvedDataMember = Omit< @@ -90,7 +106,23 @@ export interface InteractionResolvedUser { } /** @deprecated Use {@link InteractionResolvedDataChannel} */ -export type InteractionResolvedChannel = Pick +export type InteractionResolvedChannel = Pick< + Channel, + | 'id' + | 'name' + | 'type' + | 'permissions' + | 'lastMessageId' + | 'lastPinTimestamp' + | 'nsfw' + | 'parentId' + | 'guildId' + | 'flags' + | 'rateLimitPerUser' + | 'topic' + | 'position' + | 'threadMetadata' +> /** @deprecated Use {@link InteractionResolvedDataMember} */ export type InteractionResolvedMember = Omit diff --git a/packages/types/src/discord/interactions.ts b/packages/types/src/discord/interactions.ts index 0f299b1e3..33fe97eaf 100644 --- a/packages/types/src/discord/interactions.ts +++ b/packages/types/src/discord/interactions.ts @@ -148,7 +148,26 @@ export interface DiscordInteractionDataResolved { * @remarks * Only threads include `thread_metadata` and `parent_id` properties. */ - channels?: Record> + channels?: Record< + string, + Pick< + DiscordChannel, + | 'id' + | 'name' + | 'type' + | 'permissions' + | 'last_message_id' + | 'last_pin_timestamp' + | 'nsfw' + | 'parent_id' + | 'guild_id' + | 'flags' + | 'rate_limit_per_user' + | 'topic' + | 'position' + | 'thread_metadata' + > + > /** The Ids and Message objects */ messages?: Record> /** The ids and attachment objects */ @@ -232,9 +251,9 @@ export interface DiscordInteractionCallback { activity_instance_id?: string /** ID of the message that was created by the interaction */ response_message_id?: string - /** Whether or not the message is in a loading state */ + /** Whether the message is in a loading state */ response_message_loading?: boolean - /** Whether or not the response message was ephemeral */ + /** Whether the response message is ephemeral */ response_message_ephemeral?: boolean }