feat(transformers)!: Partial transformers (#4436)

* refactor(bot)!: setup desired properties for all transformers

SetupDesiredProps when is given an object that does not corrispond to a transformer object that supports desired properties will behave like TransformProperty on the entire object as when it tries to get the properties for said object it will find `never` as the props and for `IsKeyDesired` a props of `never` means that all props are desired.

* feat(transformers)!: Handle partials in transformers

* Add expiresAt to invite create event

* Use Equals helper, clean up a bit the code

* Explicit the IsKeyDesired TProps never behavior

* Fix type errors

* format

* Add all trasformer objects to bot.transformers.$inferredTypes

* Use transfromerInformations for bot.transformers.$inferredTypes

* code review

* code review

* fix component transformer

* fix

* Update packages/bot/src/transformers/types.ts

* Fixes from Tri (+ GPT sol) code review

---------

Co-authored-by: Link <link20050703@gmail.com>
This commit is contained in:
Fleny
2026-07-31 15:12:15 +05:30
committed by GitHub
co-authored by Link
parent eb4cdaa0f5
commit 4581222cf4
65 changed files with 747 additions and 487 deletions
+1 -13
View File
@@ -1,12 +1,4 @@
import type {
DiscordInviteCreate,
DiscordInviteMetadata,
GetMessagesAfter,
GetMessagesAround,
GetMessagesBefore,
GetMessagesLimit,
GetMessagesOptions,
} from '@discordeno/types';
import type { GetMessagesAfter, GetMessagesAround, GetMessagesBefore, GetMessagesLimit, GetMessagesOptions } from '@discordeno/types';
import { hasProperty } from './utils.js';
export function isGetMessagesAfter(options: GetMessagesOptions): options is GetMessagesAfter {
@@ -24,7 +16,3 @@ export function isGetMessagesAround(options: GetMessagesOptions): options is Get
export function isGetMessagesLimit(options: GetMessagesOptions): options is GetMessagesLimit {
return hasProperty(options, 'limit');
}
export function isInviteWithMetadata(options: DiscordInviteCreate | DiscordInviteMetadata): options is DiscordInviteMetadata {
return !hasProperty(options, 'channel_id');
}