From 7fa698d23e548987762c4c66c96c510d9ea56eb4 Mon Sep 17 00:00:00 2001 From: Rodry <38259440+ImRodry@users.noreply.github.com> Date: Mon, 6 Jun 2022 09:07:15 +0100 Subject: [PATCH] types(AttachmentBuilder): fix data type (#8016) * types(AttachmentBuilder): fix data type * types(MessageOptions): add AttachmentPayload --- packages/discord.js/typings/index.d.ts | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 5c2512909..835b3e087 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1701,7 +1701,7 @@ export class Message extends Base { } export class AttachmentBuilder { - public constructor(attachment: BufferResolvable | Stream, data?: RawAttachmentData); + public constructor(attachment: BufferResolvable | Stream, data?: AttachmentData); public attachment: BufferResolvable | Stream; public description: string | null; public name: string | null; @@ -3494,6 +3494,11 @@ export interface BaseApplicationCommandData { defaultPermission?: boolean; } +export interface AttachmentData { + name?: string; + description?: string; +} + export type CommandOptionDataTypeResolvable = ApplicationCommandOptionType; export type CommandOptionChannelResolvableType = ApplicationCommandOptionType.Channel; @@ -4715,7 +4720,14 @@ export interface MessageEditOptions { attachments?: JSONEncodable[]; content?: string | null; embeds?: (JSONEncodable | APIEmbed)[] | null; - files?: (BufferResolvable | Stream | JSONEncodable | Attachment | AttachmentBuilder)[]; + files?: ( + | BufferResolvable + | Stream + | JSONEncodable + | Attachment + | AttachmentBuilder + | AttachmentPayload + )[]; flags?: BitFieldResolvable; allowedMentions?: MessageMentionOptions; components?: ( @@ -4766,7 +4778,14 @@ export interface MessageOptions { | APIActionRowComponent )[]; allowedMentions?: MessageMentionOptions; - files?: (BufferResolvable | Stream | JSONEncodable | Attachment | AttachmentBuilder)[]; + files?: ( + | BufferResolvable + | Stream + | JSONEncodable + | Attachment + | AttachmentBuilder + | AttachmentPayload + )[]; reply?: ReplyOptions; stickers?: StickerResolvable[]; attachments?: JSONEncodable[];