Merge branch 'main' into feat/partial-transfromers

This commit is contained in:
Fleny
2026-01-28 20:09:09 +01:00
committed by GitHub
2 changed files with 13 additions and 10 deletions

View File

@@ -550,6 +550,7 @@ export function createDesiredPropertiesObject<T extends RecursivePartial<Transfo
webhookId: defaultValue,
poll: defaultValue,
call: defaultValue,
resolved: defaultValue,
...desiredProperties.message,
},
messageSnapshot: {
@@ -1025,12 +1026,16 @@ export type TransformProperty<T, TProps extends TransformersDesiredProperties, T
Equals<T, InteractionResolvedDataChannel<TransformersDesiredProperties, DesiredPropertiesBehavior>> extends true
? // Yes, apply the desired props
InteractionResolvedDataChannel<TProps, TBehavior>
: // Is it an object?
IsObject<T> extends true
? // Yes, we need to ensure we transform the nested properties as well
{ [K in keyof T]: TransformProperty<T[K], TProps, TBehavior> }
: // No, this is a normal value such as string / bigint / number
T;
: // Is it a function?
T extends (...args: infer P) => Promise<infer R>
? // Yes, we need to ensure we transform the return type as well
(...args: P) => Promise<TransformProperty<R, TProps, TBehavior>>
: // Is it an object?
IsObject<T> extends true
? // Yes, we need to ensure we transform the nested properties as well
{ [K in keyof T]: TransformProperty<T[K], TProps, TBehavior> }
: // No, this is a normal value such as string / bigint / number
T;
/**
* Apply desired properties to an object.

View File

@@ -1298,10 +1298,8 @@ export interface Message {
tts: boolean;
/** Whether this message came from the urgent message system */
urgent: boolean;
// TODO: Adding this causes errors in the interaction functions due to how `InteractionResolvedDataMember` and `InteractionResolvedDataChannel` are treated by `TransformProperty`, since they get their desired props changed
// and fixing this requires a few changes in `SetupDesiredProps` and `TransformProperty` so this is going to be done in another pr
// /** data for users, members, channels, and roles referenced in this message */
// resolved?: InteractionDataResolved
/** data for users, members, channels, and roles referenced in this message */
resolved?: InteractionDataResolved;
}
export interface MessageActivity {