diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 65f894503..8da3b22b6 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -810,6 +810,11 @@ export class CommandInteractionOptionResolver['member']> | null; public getRole(name: string, required: true): NonNullable['role']>; public getRole(name: string, required?: boolean): NonNullable['role']> | null; + public getAttachment(name: string, required: true): NonNullable['attachment']>; + public getAttachment( + name: string, + required?: boolean, + ): NonNullable['attachment']> | null; public getMentionable( name: string, required: true, @@ -3719,7 +3724,7 @@ export interface CommandInteractionOption member?: CacheTypeReducer; channel?: CacheTypeReducer; role?: CacheTypeReducer; - attachment?: Collection; + attachment?: MessageAttachment; message?: GuildCacheMessage; } diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index db55b6284..2bfead7e6 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -1307,3 +1307,8 @@ const selectMenu = new SelectMenuComponent({ new ActionRow({ components: [selectMenu.toJSON(), button.toJSON()], }); + +declare const chatInputInteraction: ChatInputCommandInteraction; + +expectType(chatInputInteraction.options.getAttachment('attachment', true)); +expectType(chatInputInteraction.options.getAttachment('attachment'));