@discordjs/builders 2.0.0-move-client-init.1761650119-a4c0a246f → 2.0.0-pr-11006.1765450794-e636950b2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,10 +1,12 @@
1
1
  import * as discord_api_types_v10 from 'discord-api-types/v10';
2
- import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
3
- import { JSONEncodable } from '@discordjs/util';
2
+ import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APIFileUploadComponent, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
3
+ import { JSONEncodable, RawFile, FileBodyEncodable, FileBodyEncodableResult } from '@discordjs/util';
4
+ export { RawFile } from '@discordjs/util';
4
5
  import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
5
6
  import * as zod from 'zod';
6
7
  import { z } from 'zod';
7
8
  import * as zod_v4_core from 'zod/v4/core';
9
+ import { Buffer } from 'node:buffer';
8
10
 
9
11
  interface EmojiOrLabelButtonData extends Pick<Exclude<APIButtonComponent, APIButtonComponentWithSKUId>, 'emoji' | 'label'> {
10
12
  }
@@ -172,6 +174,85 @@ declare class PremiumButtonBuilder extends BaseButtonBuilder<APIButtonComponentW
172
174
  setSKUId(skuId: Snowflake): this;
173
175
  }
174
176
 
177
+ /**
178
+ * A builder that creates API-compatible JSON data for file uploads.
179
+ */
180
+ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent> {
181
+ /**
182
+ * @internal
183
+ */
184
+ protected readonly data: Partial<APIFileUploadComponent>;
185
+ /**
186
+ * Creates a new file upload.
187
+ *
188
+ * @param data - The API data to create this file upload with
189
+ * @example
190
+ * Creating a file upload from an API data object:
191
+ * ```ts
192
+ * const fileUpload = new FileUploadBuilder({
193
+ * custom_id: "file_upload",
194
+ * min_values: 2,
195
+ * max_values: 5,
196
+ * });
197
+ * ```
198
+ * @example
199
+ * Creating a file upload using setters and API data:
200
+ * ```ts
201
+ * const fileUpload = new FileUploadBuilder({
202
+ * custom_id: "file_upload",
203
+ * min_values: 2,
204
+ * max_values: 5,
205
+ * }).setRequired();
206
+ * ```
207
+ */
208
+ constructor(data?: Partial<APIFileUploadComponent>);
209
+ /**
210
+ * Sets the custom id for this file upload.
211
+ *
212
+ * @param customId - The custom id to use
213
+ */
214
+ setCustomId(customId: string): this;
215
+ /**
216
+ * Sets the minimum number of file uploads required.
217
+ *
218
+ * @param minValues - The minimum values that must be uploaded
219
+ */
220
+ setMinValues(minValues: number): this;
221
+ /**
222
+ * Clears the minimum values.
223
+ */
224
+ clearMinValues(): this;
225
+ /**
226
+ * Sets the maximum number of file uploads required.
227
+ *
228
+ * @param maxValues - The maximum values that can be uploaded
229
+ */
230
+ setMaxValues(maxValues: number): this;
231
+ /**
232
+ * Clears the maximum values.
233
+ */
234
+ clearMaxValues(): this;
235
+ /**
236
+ * Sets whether this file upload is required.
237
+ *
238
+ * @param required - Whether this file upload is required
239
+ */
240
+ setRequired(required?: boolean): this;
241
+ /**
242
+ * {@inheritDoc ComponentBuilder.toJSON}
243
+ */
244
+ toJSON(validationOverride?: boolean): APIFileUploadComponent;
245
+ }
246
+
247
+ declare const fileUploadPredicate: z.ZodObject<{
248
+ type: z.ZodLiteral<ComponentType.FileUpload>;
249
+ id: z.ZodOptional<z.ZodInt>;
250
+ custom_id: z.ZodString;
251
+ min_values: z.ZodOptional<z.ZodInt>;
252
+ max_values: z.ZodOptional<z.ZodInt>;
253
+ required: z.ZodOptional<z.ZodBoolean>;
254
+ }, z.core.$strip>;
255
+
175
256
  /**
176
257
  * Normalizes data that is a rest parameter or an array into an array with a depth of 1.
177
258
  *
@@ -215,9 +296,9 @@ declare abstract class BaseSelectMenuBuilder<Data extends APISelectMenuComponent
215
296
  */
216
297
  setMinValues(minValues: number): this;
217
298
  /**
218
- * Sets the maximum values that must be selected in the select menu.
299
+ * Sets the maximum values that can be selected in the select menu.
219
300
  *
220
- * @param maxValues - The maximum values that must be selected
301
+ * @param maxValues - The maximum values that can be selected
221
302
  */
222
303
  setMaxValues(maxValues: number): this;
223
304
  /**
@@ -710,7 +791,7 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> {
710
791
  }
711
792
 
712
793
  interface LabelBuilderData extends Partial<Omit<APILabelComponent, 'component'>> {
713
- component?: ChannelSelectMenuBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
794
+ component?: ChannelSelectMenuBuilder | FileUploadBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
714
795
  }
715
796
  /**
716
797
  * A builder that creates API-compatible JSON data for labels.
@@ -794,6 +875,12 @@ declare class LabelBuilder extends ComponentBuilder<APILabelComponent> {
794
875
  * @param input - A function that returns a component builder or an already built builder
795
876
  */
796
877
  setTextInputComponent(input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder)): this;
878
+ /**
879
+ * Sets a file upload component to this label.
880
+ *
881
+ * @param input - A function that returns a component builder or an already built builder
882
+ */
883
+ setFileUploadComponent(input: APIFileUploadComponent | FileUploadBuilder | ((builder: FileUploadBuilder) => FileUploadBuilder)): this;
797
884
  /**
798
885
  * {@inheritDoc ComponentBuilder.toJSON}
799
886
  */
@@ -883,6 +970,13 @@ declare const labelPredicate: z.ZodObject<{
883
970
  id: z.ZodString;
884
971
  type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
885
972
  }, z.core.$strip>>>;
973
+ }, z.core.$strip>, z.ZodObject<{
974
+ type: z.ZodLiteral<ComponentType.FileUpload>;
975
+ id: z.ZodOptional<z.ZodInt>;
976
+ custom_id: z.ZodString;
977
+ min_values: z.ZodOptional<z.ZodInt>;
978
+ max_values: z.ZodOptional<z.ZodInt>;
979
+ required: z.ZodOptional<z.ZodBoolean>;
886
980
  }, z.core.$strip>]>;
887
981
  }, z.core.$strip>;
888
982
 
@@ -1474,7 +1568,7 @@ type MessageComponentBuilder = MessageActionRowComponentBuilder | MessageTopLeve
1474
1568
  /**
1475
1569
  * The builders that may be used for modals.
1476
1570
  */
1477
- type ModalComponentBuilder = ActionRowBuilder | LabelBuilder | ModalActionRowComponentBuilder;
1571
+ type ModalComponentBuilder = ActionRowBuilder | FileUploadBuilder | LabelBuilder | ModalActionRowComponentBuilder;
1478
1572
  /**
1479
1573
  * Any button builder
1480
1574
  */
@@ -1494,7 +1588,7 @@ type AnyActionRowComponentBuilder = MessageActionRowComponentBuilder | ModalActi
1494
1588
  /**
1495
1589
  * Any modal component builder.
1496
1590
  */
1497
- type AnyModalComponentBuilder = LabelBuilder | TextDisplayBuilder;
1591
+ type AnyModalComponentBuilder = FileUploadBuilder | LabelBuilder | TextDisplayBuilder;
1498
1592
  /**
1499
1593
  * Components here are mapped to their respective builder.
1500
1594
  */
@@ -1563,6 +1657,10 @@ interface MappedComponentTypes {
1563
1657
  * The label component type is associated with a {@link LabelBuilder}.
1564
1658
  */
1565
1659
  [ComponentType.Label]: LabelBuilder;
1660
+ /**
1661
+ * The file upload component type is associated with a {@link FileUploadBuilder}.
1662
+ */
1663
+ [ComponentType.FileUpload]: FileUploadBuilder;
1566
1664
  }
1567
1665
  /**
1568
1666
  * Factory for creating components from API data.
@@ -1756,7 +1854,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
1756
1854
  name: z.ZodOptional<z.ZodString>;
1757
1855
  animated: z.ZodOptional<z.ZodBoolean>;
1758
1856
  }, z.core.$strict>>;
1759
- label: z.ZodString;
1857
+ label: z.ZodOptional<z.ZodString>;
1760
1858
  }, z.core.$strict>, z.ZodObject<{
1761
1859
  type: z.ZodLiteral<ComponentType.Button>;
1762
1860
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -1766,7 +1864,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
1766
1864
  name: z.ZodOptional<z.ZodString>;
1767
1865
  animated: z.ZodOptional<z.ZodBoolean>;
1768
1866
  }, z.core.$strict>>;
1769
- label: z.ZodString;
1867
+ label: z.ZodOptional<z.ZodString>;
1770
1868
  style: z.ZodLiteral<ButtonStyle.Primary>;
1771
1869
  }, z.core.$strict>, z.ZodObject<{
1772
1870
  type: z.ZodLiteral<ComponentType.Button>;
@@ -1777,7 +1875,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
1777
1875
  name: z.ZodOptional<z.ZodString>;
1778
1876
  animated: z.ZodOptional<z.ZodBoolean>;
1779
1877
  }, z.core.$strict>>;
1780
- label: z.ZodString;
1878
+ label: z.ZodOptional<z.ZodString>;
1781
1879
  style: z.ZodLiteral<ButtonStyle.Secondary>;
1782
1880
  }, z.core.$strict>, z.ZodObject<{
1783
1881
  type: z.ZodLiteral<ComponentType.Button>;
@@ -1788,7 +1886,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
1788
1886
  name: z.ZodOptional<z.ZodString>;
1789
1887
  animated: z.ZodOptional<z.ZodBoolean>;
1790
1888
  }, z.core.$strict>>;
1791
- label: z.ZodString;
1889
+ label: z.ZodOptional<z.ZodString>;
1792
1890
  style: z.ZodLiteral<ButtonStyle.Success>;
1793
1891
  }, z.core.$strict>, z.ZodObject<{
1794
1892
  type: z.ZodLiteral<ComponentType.Button>;
@@ -1799,7 +1897,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
1799
1897
  name: z.ZodOptional<z.ZodString>;
1800
1898
  animated: z.ZodOptional<z.ZodBoolean>;
1801
1899
  }, z.core.$strict>>;
1802
- label: z.ZodString;
1900
+ label: z.ZodOptional<z.ZodString>;
1803
1901
  style: z.ZodLiteral<ButtonStyle.Danger>;
1804
1902
  }, z.core.$strict>, z.ZodObject<{
1805
1903
  type: z.ZodLiteral<ComponentType.Button>;
@@ -2740,9 +2838,7 @@ declare const chatInputCommandPredicate: z.ZodObject<{
2740
2838
  options: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
2741
2839
  type: z.ZodLiteral<ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Boolean | ApplicationCommandOptionType.User | ApplicationCommandOptionType.Channel | ApplicationCommandOptionType.Role | ApplicationCommandOptionType.Mentionable | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Attachment>;
2742
2840
  }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
2743
- type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
2744
- }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
2745
- type: z.ZodLiteral<ApplicationCommandOptionType.SubcommandGroup>;
2841
+ type: z.ZodUnion<readonly [z.ZodLiteral<ApplicationCommandOptionType.Subcommand>, z.ZodLiteral<ApplicationCommandOptionType.SubcommandGroup>]>;
2746
2842
  }, z.core.$strip>>]>>;
2747
2843
  }, z.core.$strip>;
2748
2844
  declare const chatInputCommandSubcommandGroupPredicate: z.ZodObject<{
@@ -2995,6 +3091,13 @@ declare const modalPredicate: z.ZodObject<{
2995
3091
  id: z.ZodString;
2996
3092
  type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
2997
3093
  }, z.core.$strip>>>;
3094
+ }, z.core.$strip>, z.ZodObject<{
3095
+ type: z.ZodLiteral<ComponentType.FileUpload>;
3096
+ id: z.ZodOptional<z.ZodInt>;
3097
+ custom_id: z.ZodString;
3098
+ min_values: z.ZodOptional<z.ZodInt>;
3099
+ max_values: z.ZodOptional<z.ZodInt>;
3100
+ required: z.ZodOptional<z.ZodBoolean>;
2998
3101
  }, z.core.$strip>]>;
2999
3102
  }, z.core.$strip>, z.ZodObject<{
3000
3103
  type: z.ZodLiteral<ComponentType.TextDisplay>;
@@ -3879,6 +3982,12 @@ declare class AllowedMentionsBuilder implements JSONEncodable<APIAllowedMentions
3879
3982
  toJSON(validationOverride?: boolean): APIAllowedMentions;
3880
3983
  }
3881
3984
 
3985
+ declare const rawFilePredicate: z.ZodObject<{
3986
+ data: z.ZodUnion<readonly [z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodString]>;
3987
+ name: z.ZodString;
3988
+ contentType: z.ZodOptional<z.ZodString>;
3989
+ key: z.ZodOptional<z.ZodString>;
3990
+ }, z.core.$strip>;
3882
3991
  declare const attachmentPredicate: z.ZodObject<{
3883
3992
  id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
3884
3993
  description: z.ZodOptional<z.ZodString>;
@@ -4018,6 +4127,132 @@ declare const messagePredicate: z.ZodUnion<readonly [z.ZodObject<{
4018
4127
  sticker_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNever>>>;
4019
4128
  poll: z.ZodOptional<z.ZodNull>;
4020
4129
  }, z.core.$strip>]>;
4130
+ declare const fileBodyMessagePredicate: z.ZodObject<{
4131
+ body: z.ZodUnion<readonly [z.ZodObject<{
4132
+ nonce: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
4133
+ tts: z.ZodOptional<z.ZodBoolean>;
4134
+ allowed_mentions: z.ZodOptional<z.ZodObject<{
4135
+ parse: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof AllowedMentionsTypes>>>;
4136
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
4137
+ users: z.ZodOptional<z.ZodArray<z.ZodString>>;
4138
+ replied_user: z.ZodOptional<z.ZodBoolean>;
4139
+ }, z.core.$strip>>;
4140
+ message_reference: z.ZodOptional<z.ZodObject<{
4141
+ channel_id: z.ZodOptional<z.ZodString>;
4142
+ fail_if_not_exists: z.ZodOptional<z.ZodBoolean>;
4143
+ guild_id: z.ZodOptional<z.ZodString>;
4144
+ message_id: z.ZodString;
4145
+ type: z.ZodOptional<z.ZodEnum<typeof MessageReferenceType>>;
4146
+ }, z.core.$strip>>;
4147
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
4148
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
4149
+ description: z.ZodOptional<z.ZodString>;
4150
+ duration_secs: z.ZodOptional<z.ZodNumber>;
4151
+ filename: z.ZodOptional<z.ZodString>;
4152
+ title: z.ZodOptional<z.ZodString>;
4153
+ waveform: z.ZodOptional<z.ZodString>;
4154
+ }, z.core.$strip>>>;
4155
+ enforce_nonce: z.ZodOptional<z.ZodBoolean>;
4156
+ content: z.ZodOptional<z.ZodString>;
4157
+ embeds: z.ZodOptional<z.ZodArray<z.ZodObject<{
4158
+ title: z.ZodOptional<z.ZodString>;
4159
+ description: z.ZodOptional<z.ZodString>;
4160
+ url: z.ZodOptional<z.ZodURL>;
4161
+ timestamp: z.ZodOptional<z.ZodString>;
4162
+ color: z.ZodOptional<z.ZodInt>;
4163
+ footer: z.ZodOptional<z.ZodObject<{
4164
+ text: z.ZodString;
4165
+ icon_url: z.ZodOptional<z.ZodURL>;
4166
+ }, z.core.$strip>>;
4167
+ image: z.ZodOptional<z.ZodObject<{
4168
+ url: z.ZodURL;
4169
+ }, z.core.$strip>>;
4170
+ thumbnail: z.ZodOptional<z.ZodObject<{
4171
+ url: z.ZodURL;
4172
+ }, z.core.$strip>>;
4173
+ author: z.ZodOptional<z.ZodObject<{
4174
+ name: z.ZodString;
4175
+ icon_url: z.ZodOptional<z.ZodURL>;
4176
+ url: z.ZodOptional<z.ZodURL>;
4177
+ }, z.core.$strip>>;
4178
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
4179
+ name: z.ZodString;
4180
+ value: z.ZodString;
4181
+ inline: z.ZodOptional<z.ZodBoolean>;
4182
+ }, z.core.$strip>>>;
4183
+ }, z.core.$strip>>>;
4184
+ sticker_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
4185
+ poll: z.ZodOptional<z.ZodObject<{
4186
+ question: z.ZodObject<{
4187
+ text: z.ZodString;
4188
+ }, z.core.$strip>;
4189
+ answers: z.ZodArray<z.ZodObject<{
4190
+ poll_media: z.ZodObject<{
4191
+ text: z.ZodString;
4192
+ emoji: z.ZodOptional<z.ZodObject<{
4193
+ id: z.ZodOptional<z.ZodString>;
4194
+ name: z.ZodOptional<z.ZodString>;
4195
+ animated: z.ZodOptional<z.ZodBoolean>;
4196
+ }, z.core.$strict>>;
4197
+ }, z.core.$strip>;
4198
+ }, z.core.$strip>>;
4199
+ duration: z.ZodOptional<z.ZodNumber>;
4200
+ allow_multiselect: z.ZodOptional<z.ZodBoolean>;
4201
+ layout_type: z.ZodOptional<z.ZodEnum<typeof discord_api_types_v10.PollLayoutType>>;
4202
+ }, z.core.$strip>>;
4203
+ components: z.ZodOptional<z.ZodArray<z.ZodObject<{
4204
+ type: z.ZodLiteral<ComponentType.ActionRow>;
4205
+ components: z.ZodArray<z.ZodObject<{
4206
+ type: z.ZodLiteral<ComponentType.Button | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect>;
4207
+ }, z.core.$strip>>;
4208
+ }, z.core.$strip>>>;
4209
+ flags: z.ZodOptional<z.ZodInt>;
4210
+ }, z.core.$strip>, z.ZodObject<{
4211
+ nonce: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
4212
+ tts: z.ZodOptional<z.ZodBoolean>;
4213
+ allowed_mentions: z.ZodOptional<z.ZodObject<{
4214
+ parse: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof AllowedMentionsTypes>>>;
4215
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
4216
+ users: z.ZodOptional<z.ZodArray<z.ZodString>>;
4217
+ replied_user: z.ZodOptional<z.ZodBoolean>;
4218
+ }, z.core.$strip>>;
4219
+ message_reference: z.ZodOptional<z.ZodObject<{
4220
+ channel_id: z.ZodOptional<z.ZodString>;
4221
+ fail_if_not_exists: z.ZodOptional<z.ZodBoolean>;
4222
+ guild_id: z.ZodOptional<z.ZodString>;
4223
+ message_id: z.ZodString;
4224
+ type: z.ZodOptional<z.ZodEnum<typeof MessageReferenceType>>;
4225
+ }, z.core.$strip>>;
4226
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
4227
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
4228
+ description: z.ZodOptional<z.ZodString>;
4229
+ duration_secs: z.ZodOptional<z.ZodNumber>;
4230
+ filename: z.ZodOptional<z.ZodString>;
4231
+ title: z.ZodOptional<z.ZodString>;
4232
+ waveform: z.ZodOptional<z.ZodString>;
4233
+ }, z.core.$strip>>>;
4234
+ enforce_nonce: z.ZodOptional<z.ZodBoolean>;
4235
+ components: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
4236
+ type: z.ZodLiteral<ComponentType.ActionRow>;
4237
+ components: z.ZodArray<z.ZodObject<{
4238
+ type: z.ZodLiteral<ComponentType.Button | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect>;
4239
+ }, z.core.$strip>>;
4240
+ }, z.core.$strip>, z.ZodObject<{
4241
+ type: z.ZodLiteral<ComponentType.Section | ComponentType.TextDisplay | ComponentType.Thumbnail | ComponentType.MediaGallery | ComponentType.File | ComponentType.Separator | ComponentType.Container>;
4242
+ }, z.core.$strip>]>>;
4243
+ flags: z.ZodInt;
4244
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4245
+ embeds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNever>>>;
4246
+ sticker_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNever>>>;
4247
+ poll: z.ZodOptional<z.ZodNull>;
4248
+ }, z.core.$strip>]>;
4249
+ files: z.ZodArray<z.ZodObject<{
4250
+ data: z.ZodUnion<readonly [z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodString]>;
4251
+ name: z.ZodString;
4252
+ contentType: z.ZodOptional<z.ZodString>;
4253
+ key: z.ZodOptional<z.ZodString>;
4254
+ }, z.core.$strip>>;
4255
+ }, z.core.$strip>;
4021
4256
 
4022
4257
  /**
4023
4258
  * A builder that creates API-compatible JSON data for attachments.
@@ -4027,10 +4262,25 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
4027
4262
  * The API data associated with this attachment.
4028
4263
  */
4029
4264
  private readonly data;
4265
+ /**
4266
+ * This data is not included in the output of `toJSON()`. For this class specifically, this refers to binary data
4267
+ * that will wind up being included in the multipart/form-data request, if used with the `MessageBuilder`.
4268
+ * To retrieve this data, use {@link getRawFile}.
4269
+ *
4270
+ * @remarks This cannot be set via the constructor, primarily because of the behavior described
4271
+ * {@link https://discord.com/developers/docs/reference#editing-message-attachments | here}.
4272
+ * That is, when editing a message's attachments, you should only be providing file data for new attachments.
4273
+ */
4274
+ private readonly fileData;
4030
4275
  /**
4031
4276
  * Creates a new attachment builder.
4032
4277
  *
4033
4278
  * @param data - The API data to create this attachment with
4279
+ * @example
4280
+ * ```ts
4281
+ * const attachment = new AttachmentBuilder().setId(1).setFileData(':)').setFilename('smiley.txt')
4282
+ * ```
4283
+ * @remarks Please note that the `id` field is required, it's rather easy to miss!
4034
4284
  */
4035
4285
  constructor(data?: Partial<RESTAPIAttachment>);
4036
4286
  /**
@@ -4038,7 +4288,7 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
4038
4288
  *
4039
4289
  * @param id - The id of the attachment
4040
4290
  */
4041
- setId(id: Snowflake): this;
4291
+ setId(id: Snowflake | number): this;
4042
4292
  /**
4043
4293
  * Sets the description of this attachment.
4044
4294
  *
@@ -4069,6 +4319,33 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
4069
4319
  * Clears the filename of this attachment.
4070
4320
  */
4071
4321
  clearFilename(): this;
4322
+ /**
4323
+ * Sets the file data to upload with this attachment.
4324
+ *
4325
+ * @param data - The file data
4326
+ * @remarks Note that this data is NOT included in the {@link toJSON} output. To retrieve it, use {@link getRawFile}.
4327
+ */
4328
+ setFileData(data: Buffer | Uint8Array | string): this;
4329
+ /**
4330
+ * Clears the file data from this attachment.
4331
+ */
4332
+ clearFileData(): this;
4333
+ /**
4334
+ * Sets the content type of the file data to upload with this attachment.
4335
+ *
4336
+ * @remarks Note that this data is NOT included in the {@link toJSON} output. To retrieve it, use {@link getRawFile}.
4337
+ */
4338
+ setFileContentType(contentType: string): this;
4339
+ /**
4340
+ * Clears the content type of the file data from this attachment.
4341
+ */
4342
+ clearFileContentType(): this;
4343
+ /**
4344
+ * Converts this attachment to a {@link RawFile} for uploading.
4345
+ *
4346
+ * @returns A {@link RawFile} object, or `undefined` if no file data is set
4347
+ */
4348
+ getRawFile(): Partial<RawFile> | undefined;
4072
4349
  /**
4073
4350
  * Sets the title of this attachment.
4074
4351
  *
@@ -4176,7 +4453,7 @@ interface MessageBuilderData extends Partial<Omit<RESTPostAPIChannelMessageJSONB
4176
4453
  /**
4177
4454
  * A builder that creates API-compatible JSON data for messages.
4178
4455
  */
4179
- declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJSONBody> {
4456
+ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJSONBody>, FileBodyEncodable<RESTPostAPIChannelMessageJSONBody> {
4180
4457
  /**
4181
4458
  * The API data associated with this message.
4182
4459
  */
@@ -4289,7 +4566,7 @@ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJ
4289
4566
  *
4290
4567
  * @param allowedMentions - The allowed mentions to set
4291
4568
  */
4292
- setAllowedMentions(allowedMentions: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
4569
+ setAllowedMentions(allowedMentions?: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
4293
4570
  /**
4294
4571
  * Updates the allowed mentions for this message (and creates it if it doesn't exist)
4295
4572
  *
@@ -4509,15 +4786,17 @@ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJ
4509
4786
  * @param validationOverride - Force validation to run/not run regardless of your global preference
4510
4787
  */
4511
4788
  toJSON(validationOverride?: boolean): RESTPostAPIChannelMessageJSONBody;
4789
+ /**
4790
+ * Serializes this builder to both JSON body and file data for multipart/form-data requests.
4791
+ *
4792
+ * @param validationOverride - Force validation to run/not run regardless of your global preference
4793
+ * @remarks
4794
+ * This method extracts file data from attachments that have files set via {@link AttachmentBuilder.setFileData}.
4795
+ * The returned body includes attachment metadata, while files contains the binary data for upload.
4796
+ */
4797
+ toFileBody(validationOverride?: boolean): FileBodyEncodableResult<RESTPostAPIChannelMessageJSONBody>;
4512
4798
  }
4513
4799
 
4514
- /**
4515
- * Calculates the length of the embed.
4516
- *
4517
- * @param data - The embed data to check
4518
- */
4519
- declare function embedLength(data: APIEmbed): number;
4520
-
4521
4800
  /**
4522
4801
  * "Resolves" a builder from the 3 ways it can be input:
4523
4802
  * 1. A clean instance
@@ -4564,6 +4843,7 @@ declare class ValidationError extends Error {
4564
4843
 
4565
4844
  declare const idPredicate: z.ZodOptional<z.ZodInt>;
4566
4845
  declare const customIdPredicate: z.ZodString;
4846
+ declare const snowflakePredicate: z.ZodString;
4567
4847
  declare const memberPermissionsPredicate: z.ZodCoercedBigInt<unknown>;
4568
4848
  declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>;
4569
4849
 
@@ -4575,4 +4855,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
4575
4855
  */
4576
4856
  declare const version: string;
4577
4857
 
4578
- export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };
4858
+ export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, FileUploadBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedPredicate, emojiPredicate, enableValidators, fileBodyMessagePredicate, filePredicate, fileUploadPredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, rawFilePredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, snowflakePredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };