mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types: fix cache type fallback types (#6961)
This commit is contained in:
6
typings/index.d.ts
vendored
6
typings/index.d.ts
vendored
@@ -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;
|
||||
|
||||
|
||||
@@ -913,6 +913,7 @@ declare const booleanValue: boolean;
|
||||
if (interaction.inGuild()) assertType<Snowflake>(interaction.guildId);
|
||||
|
||||
client.on('interactionCreate', async interaction => {
|
||||
assertType<Snowflake | null>(interaction.guildId);
|
||||
if (interaction.inCachedGuild()) {
|
||||
assertType<GuildMember>(interaction.member);
|
||||
// @ts-expect-error
|
||||
|
||||
Reference in New Issue
Block a user