types(Interaction): improve type guard for inGuild() (#6644)

This commit is contained in:
Apokalypt
2021-09-23 13:42:27 +02:00
committed by GitHub
parent b9a4899491
commit 034782641a

6
typings/index.d.ts vendored
View File

@@ -1025,7 +1025,11 @@ export class Interaction extends Base {
public type: InteractionType;
public user: User;
public version: number;
public inGuild(): this is this & { guildId: Snowflake; member: GuildMember | APIInteractionGuildMember };
public inGuild(): this is this & {
guildId: Snowflake;
member: GuildMember | APIInteractionGuildMember;
readonly channel: Exclude<TextBasedChannels, PartialDMChannel | DMChannel> | null;
};
public isButton(): this is ButtonInteraction;
public isCommand(): this is CommandInteraction;
public isContextMenu(): this is ContextMenuInteraction;