fix: isMenu() guard type

This commit is contained in:
MARCROCK22 2024-03-27 20:26:43 -04:00
parent 67c90eb03a
commit d0425020bf

View File

@ -1,10 +1,10 @@
import { ApplicationCommandType, InteractionType } from 'discord-api-types/v10'; import { ApplicationCommandType, InteractionType } from 'discord-api-types/v10';
import type { ComponentContext, ComponentCommandInteractionMap } from '../components/componentcontext'; import type { ComponentCommandInteractionMap, ComponentContext } from '../components/componentcontext';
import { import {
type ChatInputCommandInteraction,
type ComponentInteraction,
Message, Message,
User, User,
type ChatInputCommandInteraction,
type ComponentInteraction,
type MessageCommandInteraction, type MessageCommandInteraction,
type UserCommandInteraction, type UserCommandInteraction,
} from '../structures'; } from '../structures';
@ -24,7 +24,7 @@ export class BaseContext {
return this.message || (this.interaction as ChatInputCommandInteraction).type === ApplicationCommandType.ChatInput; return this.message || (this.interaction as ChatInputCommandInteraction).type === ApplicationCommandType.ChatInput;
} }
isMenu(): this is MenuCommandContext<any> { isMenu(): this is MenuCommandContext<UserCommandInteraction | MessageCommandInteraction> {
return this.isMenuUser() || this.isMenuMessage(); return this.isMenuUser() || this.isMenuMessage();
} }