feat(commands): attachment options (#7441)

This commit is contained in:
Ryan Munro
2022-02-13 22:41:41 +11:00
committed by GitHub
parent 988a51b764
commit 5bcca8b97f
6 changed files with 37 additions and 1 deletions

1
typings/enums.d.ts vendored
View File

@@ -27,6 +27,7 @@ export const enum ApplicationCommandOptionTypes {
ROLE = 8,
MENTIONABLE = 9,
NUMBER = 10,
ATTACHMENT = 11,
}
export const enum ApplicationCommandPermissionTypes {

8
typings/index.d.ts vendored
View File

@@ -335,6 +335,7 @@ export abstract class BaseCommandInteraction<Cached extends CacheType = CacheTyp
| 'getBoolean'
| 'getSubcommandGroup'
| 'getSubcommand'
| 'getAttachment'
>;
public channelId: Snowflake;
public commandId: Snowflake;
@@ -798,6 +799,11 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
public getMessage(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['message']> | null;
public getFocused(getFull: true): ApplicationCommandOptionChoice;
public getFocused(getFull?: boolean): string | number;
public getAttachment(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['attachment']>;
public getAttachment(
name: string,
required?: boolean,
): NonNullable<CommandInteractionOption<Cached>['attachment']> | null;
}
export class ContextMenuInteraction<Cached extends CacheType = CacheType> extends BaseCommandInteraction<Cached> {
@@ -4102,6 +4108,7 @@ export interface CommandInteractionOption<Cached extends CacheType = CacheType>
channel?: CacheTypeReducer<Cached, GuildBasedChannel, APIInteractionDataResolvedChannel>;
role?: CacheTypeReducer<Cached, Role, APIRole>;
message?: GuildCacheMessage<Cached>;
attachment?: MessageAttachment;
}
export interface CommandInteractionResolvedData<Cached extends CacheType = CacheType> {
@@ -4110,6 +4117,7 @@ export interface CommandInteractionResolvedData<Cached extends CacheType = Cache
roles?: Collection<Snowflake, CacheTypeReducer<Cached, Role, APIRole>>;
channels?: Collection<Snowflake, CacheTypeReducer<Cached, AnyChannel, APIInteractionDataResolvedChannel>>;
messages?: Collection<Snowflake, CacheTypeReducer<Cached, Message, APIMessage>>;
attachments?: Collection<Snowflake, MessageAttachment>;
}
export interface ConstantsClientApplicationAssetTypes {