types: Fix possibly null message properties (#7111)

This commit is contained in:
Jiralite
2021-12-15 12:39:05 +00:00
committed by GitHub
parent a0fe0acbf1
commit bc6a6c539f
2 changed files with 26 additions and 3 deletions

6
typings/index.d.ts vendored
View File

@@ -1566,7 +1566,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
public channelId: Snowflake;
public deferred: boolean;
public ephemeral: boolean | null;
public message: CacheTypeReducer<Cached, Message, APIMessage>;
public message: GuildCacheMessage<Cached>;
public replied: boolean;
public webhook: InteractionWebhook;
public inGuild(): this is MessageComponentInteraction<'present'>;
@@ -1591,7 +1591,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
export class MessageContextMenuInteraction<
Cached extends CacheType = CacheType,
> extends ContextMenuInteraction<Cached> {
public readonly targetMessage: CacheTypeReducer<Cached, Message, APIMessage>;
public readonly targetMessage: NonNullable<CommandInteractionOption<Cached>['message']>;
public inGuild(): this is MessageContextMenuInteraction<'present'>;
public inCachedGuild(): this is MessageContextMenuInteraction<'cached'>;
public inRawGuild(): this is MessageContextMenuInteraction<'raw'>;
@@ -3924,7 +3924,7 @@ export interface CommandInteractionOption<Cached extends CacheType = CacheType>
member?: CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>;
channel?: CacheTypeReducer<Cached, GuildChannel | ThreadChannel, APIInteractionDataResolvedChannel>;
role?: CacheTypeReducer<Cached, Role, APIRole>;
message?: CacheTypeReducer<Cached, Message, APIMessage>;
message?: GuildCacheMessage<Cached>;
}
export interface CommandInteractionResolvedData<Cached extends CacheType = CacheType> {