mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +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,
|
RawType = CachedType,
|
||||||
PresentType = CachedType | RawType,
|
PresentType = CachedType | RawType,
|
||||||
Fallback = PresentType | null,
|
Fallback = PresentType | null,
|
||||||
> = State extends 'cached'
|
> = [State] extends ['cached']
|
||||||
? CachedType
|
? CachedType
|
||||||
: State extends 'raw'
|
: [State] extends ['raw']
|
||||||
? RawType
|
? RawType
|
||||||
: State extends 'present'
|
: [State] extends ['present']
|
||||||
? PresentType
|
? PresentType
|
||||||
: Fallback;
|
: Fallback;
|
||||||
|
|
||||||
|
|||||||
@@ -913,6 +913,7 @@ declare const booleanValue: boolean;
|
|||||||
if (interaction.inGuild()) assertType<Snowflake>(interaction.guildId);
|
if (interaction.inGuild()) assertType<Snowflake>(interaction.guildId);
|
||||||
|
|
||||||
client.on('interactionCreate', async interaction => {
|
client.on('interactionCreate', async interaction => {
|
||||||
|
assertType<Snowflake | null>(interaction.guildId);
|
||||||
if (interaction.inCachedGuild()) {
|
if (interaction.inCachedGuild()) {
|
||||||
assertType<GuildMember>(interaction.member);
|
assertType<GuildMember>(interaction.member);
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
|
|||||||
Reference in New Issue
Block a user