mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user