mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix: attachment types (#7478)
This commit is contained in:
7
packages/discord.js/typings/index.d.ts
vendored
7
packages/discord.js/typings/index.d.ts
vendored
@@ -810,6 +810,11 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
|
||||
public getMember(name: string): NonNullable<CommandInteractionOption<Cached>['member']> | null;
|
||||
public getRole(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['role']>;
|
||||
public getRole(name: string, required?: boolean): NonNullable<CommandInteractionOption<Cached>['role']> | null;
|
||||
public getAttachment(name: string, required: true): NonNullable<CommandInteractionOption<Cached>['attachment']>;
|
||||
public getAttachment(
|
||||
name: string,
|
||||
required?: boolean,
|
||||
): NonNullable<CommandInteractionOption<Cached>['attachment']> | null;
|
||||
public getMentionable(
|
||||
name: string,
|
||||
required: true,
|
||||
@@ -3719,7 +3724,7 @@ export interface CommandInteractionOption<Cached extends CacheType = CacheType>
|
||||
member?: CacheTypeReducer<Cached, GuildMember, APIInteractionDataResolvedGuildMember>;
|
||||
channel?: CacheTypeReducer<Cached, GuildBasedChannel, APIInteractionDataResolvedChannel>;
|
||||
role?: CacheTypeReducer<Cached, Role, APIRole>;
|
||||
attachment?: Collection<Snowflake, MessageAttachment>;
|
||||
attachment?: MessageAttachment;
|
||||
message?: GuildCacheMessage<Cached>;
|
||||
}
|
||||
|
||||
|
||||
@@ -1307,3 +1307,8 @@ const selectMenu = new SelectMenuComponent({
|
||||
new ActionRow({
|
||||
components: [selectMenu.toJSON(), button.toJSON()],
|
||||
});
|
||||
|
||||
declare const chatInputInteraction: ChatInputCommandInteraction;
|
||||
|
||||
expectType<MessageAttachment>(chatInputInteraction.options.getAttachment('attachment', true));
|
||||
expectType<MessageAttachment | null>(chatInputInteraction.options.getAttachment('attachment'));
|
||||
|
||||
Reference in New Issue
Block a user