types(AttachmentBuilder): fix data type (#8016)

* types(AttachmentBuilder): fix data type

* types(MessageOptions): add AttachmentPayload
This commit is contained in:
Rodry
2022-06-06 09:07:15 +01:00
committed by GitHub
parent b9df37a89f
commit 7fa698d23e

View File

@@ -1701,7 +1701,7 @@ export class Message<Cached extends boolean = boolean> 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<AttachmentPayload>[];
content?: string | null;
embeds?: (JSONEncodable<APIEmbed> | APIEmbed)[] | null;
files?: (BufferResolvable | Stream | JSONEncodable<APIAttachment> | Attachment | AttachmentBuilder)[];
files?: (
| BufferResolvable
| Stream
| JSONEncodable<APIAttachment>
| Attachment
| AttachmentBuilder
| AttachmentPayload
)[];
flags?: BitFieldResolvable<MessageFlagsString, number>;
allowedMentions?: MessageMentionOptions;
components?: (
@@ -4766,7 +4778,14 @@ export interface MessageOptions {
| APIActionRowComponent<APIMessageActionRowComponent>
)[];
allowedMentions?: MessageMentionOptions;
files?: (BufferResolvable | Stream | JSONEncodable<APIAttachment> | Attachment | AttachmentBuilder)[];
files?: (
| BufferResolvable
| Stream
| JSONEncodable<APIAttachment>
| Attachment
| AttachmentBuilder
| AttachmentPayload
)[];
reply?: ReplyOptions;
stickers?: StickerResolvable[];
attachments?: JSONEncodable<AttachmentPayload>[];