mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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>
|
||||
*/
|
||||
|
||||
6
packages/discord.js/typings/index.d.ts
vendored
6
packages/discord.js/typings/index.d.ts
vendored
@@ -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>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user