Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ export interface SelectMenuModalData<Cached extends CacheType = CacheType> exten
}

export interface FileUploadModalData extends BaseModalData<ComponentType.FileUpload> {
attachments: ReadonlyCollection<Snowflake, Attachment>;
attachments?: ReadonlyCollection<Snowflake, Attachment>;
customId: string;
values: readonly Snowflake[];
}
Expand Down
5 changes: 5 additions & 0 deletions packages/discord.js/typings/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import type {
FetchedThreadsMore,
FetchPinnedMessagesResponse,
FileComponentData,
FileUploadModalData,
ForumChannel,
Guild,
GuildApplicationCommandManager,
Expand Down Expand Up @@ -3044,3 +3045,7 @@ await textChannel.send({
],
flags: MessageFlags.IsVoiceMessage,
});

// FileUploadModalData.attachments should be optional (issue #11359)
declare const fileUploadModalData: FileUploadModalData;
expectType<ReadonlyCollection<Snowflake, Attachment> | undefined>(fileUploadModalData.attachments);