diff --git a/plugins/cache/src/setupCacheRemovals.ts b/plugins/cache/src/setupCacheRemovals.ts index 582bef3f6..8410f511f 100644 --- a/plugins/cache/src/setupCacheRemovals.ts +++ b/plugins/cache/src/setupCacheRemovals.ts @@ -67,7 +67,6 @@ export function setupCacheRemovals(bot: BotWithCache) { bot.handlers.GUILD_EMOJIS_UPDATE = function (_, data, shardId) { const payload = data.d as DiscordGuildEmojisUpdate; - const guild = bot.guilds.get(bot.transformers.snowflake(payload.guild_id)); if (guild) { diff --git a/types/shared.ts b/types/shared.ts index 4867c9fa9..d477cc065 100644 --- a/types/shared.ts +++ b/types/shared.ts @@ -1242,7 +1242,7 @@ export type Camelize = { : never; }; -// export type Optionalize = T extends object ? +// export type Optionalize = T extends object ? // & { // [K in KeysWithUndefined]?: Optionalize; // } @@ -1252,17 +1252,19 @@ export type Camelize = { // : T; export type KeysWithUndefined = { - [K in keyof T]-?: (undefined | null) extends T[K] ? K : never; + [K in keyof T]-?: undefined extends T[K] + ? K + : null extends T[K] + ? K + : never; }[keyof T]; export type Optionalize = ( - & { - [K in KeysWithUndefined]?: Optionalize; + &{ + [K in KeysWithUndefined]?: T[K] + } & { + [K in Exclude>]: T[K] extends object + ? Object extends Pick ? T[K] : Optionalize + : T[K]; } - & { - [K in Exclude>]: ( - // deno-lint-ignore ban-types - T[K] extends object ? Object extends Pick ? T[K] : Optionalize : T[K] - ); - } -); +); \ No newline at end of file