types(fix): BaseCommandInteractionOptionResolver and CommandInteraction (#6910)

This commit is contained in:
Indian Ocean Roleplay
2021-10-29 23:08:21 +05:30
committed by GitHub
parent d6685b1c50
commit 673c03f7cf

16
typings/index.d.ts vendored
View File

@@ -280,6 +280,7 @@ export abstract class BaseCommandInteraction<Cached extends CacheType = CacheTyp
public readonly command: ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
public options: Omit<
CommandInteractionOptionResolver<Cached>,
| 'getMessage'
| 'getFocused'
| 'getMentionable'
| 'getRole'
@@ -602,7 +603,7 @@ export abstract class Collector<K, V, F extends unknown[] = []> extends EventEmi
}
export interface ApplicationCommandInteractionOptionResolver<Cached extends CacheType = CacheType>
extends BaseCommandInteractionOptionResolver<Cached> {
extends CommandInteractionOptionResolver<Cached> {
getSubcommand(required?: true): string;
getSubcommand(required: boolean): string | null;
getSubcommandGroup(required?: true): string;
@@ -714,6 +715,19 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
}
export class ContextMenuInteraction<Cached extends CacheType = CacheType> extends BaseCommandInteraction<Cached> {
public options: Omit<
CommandInteractionOptionResolver<Cached>,
| 'getFocused'
| 'getMentionable'
| 'getRole'
| 'getNumber'
| 'getInteger'
| 'getString'
| 'getChannel'
| 'getBoolean'
| 'getSubcommandGroup'
| 'getSubcommand'
>;
public targetId: Snowflake;
public targetType: Exclude<ApplicationCommandType, 'CHAT_INPUT'>;
private resolveContextMenuOptions(data: APIApplicationCommandInteractionData): CommandInteractionOption<Cached>[];