types(MessageEditOptions): Correct attachments type (#9874)

types(MessageEditOptions): fix `attachments` type

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2023-10-09 09:18:41 +02:00
committed by GitHub
parent ec47e72b41
commit 2aa3250584
2 changed files with 13 additions and 3 deletions

View File

@@ -152,11 +152,17 @@ class MessageManager extends CachedManager {
* @returns {?Snowflake}
*/
/**
* Data used to reference an attachment.
* @typedef {Object} MessageEditAttachmentData
* @property {Snowflake} id The id of the attachment
*/
/**
* Options that can be passed to edit a message.
* @typedef {BaseMessageOptions} MessageEditOptions
* @property {AttachmentPayload[]} [attachments] An array of attachments to keep,
* all attachments will be kept if omitted
* @property {Array<Attachment|MessageEditAttachmentData>} [attachments] An array of attachments to keep.
* All attachments will be kept if omitted
* @property {MessageFlags} [flags] Which flags to set for the message
* <info>Only the {@link MessageFlags.SuppressEmbeds} flag can be modified.</info>
*/

View File

@@ -6003,9 +6003,13 @@ export interface MessageCreateOptions extends BaseMessageOptions {
export type GuildForumThreadMessageCreateOptions = BaseMessageOptions &
Pick<MessageCreateOptions, 'flags' | 'stickers'>;
export interface MessageEditAttachmentData {
id: Snowflake;
}
export interface MessageEditOptions extends Omit<BaseMessageOptions, 'content'> {
content?: string | null;
attachments?: JSONEncodable<AttachmentPayload>[];
attachments?: (Attachment | MessageEditAttachmentData)[];
flags?: BitFieldResolvable<Extract<MessageFlagsString, 'SuppressEmbeds'>, MessageFlags.SuppressEmbeds>;
}