diff --git a/packages/bot/src/commandOptionsParser.ts b/packages/bot/src/commandOptionsParser.ts index 02f92873e..6d2acd202 100644 --- a/packages/bot/src/commandOptionsParser.ts +++ b/packages/bot/src/commandOptionsParser.ts @@ -2,6 +2,7 @@ import { ApplicationCommandOptionTypes } from '@discordeno/types' import type { Attachment, Channel, + CompleteDesiredProperties, DesiredPropertiesBehavior, Interaction, InteractionDataOption, @@ -11,17 +12,16 @@ import type { TransformProperty, TransformersDesiredProperties, User, - WithAtLeast, } from './index.js' export function commandOptionsParser< - TProps extends WithAtLeast, + TProps extends TransformersDesiredProperties & { interaction: { data: true } }, TBehavior extends DesiredPropertiesBehavior, >(__interaction: SetupDesiredProps, options?: InteractionDataOption[]): ParsedInteractionOption { // This is necessary as typescript gets really confused when using __interaction alone, as it will say that 'data' does not exist despite it surely exist since we have the WithAtLeast const interaction = __interaction as SetupDesiredProps< Interaction, - WithAtLeast, + CompleteDesiredProperties<{ interaction: { data: true } }>, DesiredPropertiesBehavior.RemoveKey > diff --git a/packages/bot/src/desiredProperties.ts b/packages/bot/src/desiredProperties.ts index 9b04467c2..3bd32486f 100644 --- a/packages/bot/src/desiredProperties.ts +++ b/packages/bot/src/desiredProperties.ts @@ -729,10 +729,6 @@ type Complete = { [K in keyof TObj]-?: undefined extends TObj[K] ? TDefault : Exclude } -export type WithAtLeast> = T & { - [K in keyof T]: K extends keyof AtLeast ? Complete & T[K] : T[K] -} - type JoinTuple = T extends readonly [infer F extends string, ...infer R extends string[]] ? R['length'] extends 0 ? F