diff --git a/typings/index.d.ts b/typings/index.d.ts index d79e51123..47123c7e8 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1177,11 +1177,11 @@ export type CacheTypeReducer< RawType = CachedType, PresentType = CachedType | RawType, Fallback = PresentType | null, -> = State extends 'cached' +> = [State] extends ['cached'] ? CachedType - : State extends 'raw' + : [State] extends ['raw'] ? RawType - : State extends 'present' + : [State] extends ['present'] ? PresentType : Fallback; diff --git a/typings/tests.ts b/typings/tests.ts index f132aff7b..ffe003437 100644 --- a/typings/tests.ts +++ b/typings/tests.ts @@ -913,6 +913,7 @@ declare const booleanValue: boolean; if (interaction.inGuild()) assertType(interaction.guildId); client.on('interactionCreate', async interaction => { + assertType(interaction.guildId); if (interaction.inCachedGuild()) { assertType(interaction.member); // @ts-expect-error