@discordjs/builders 2.0.0-dev.1784333790-d29e25d24 → 2.0.0-dev.1784551164-2de90a767
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 +125 -19
- package/dist/index.d.ts +125 -19
- package/dist/index.js +82 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +84 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
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, ApplicationCommandOptionAllowedChannelType, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, ApplicationCommandType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, BaseThemeType, RESTAPIAttachment, RESTAPIMessageReference, APIMessageSharedClientTheme, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
|
|
2
|
+
import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APIFileUploadComponent, FileUploadType, 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, ApplicationCommandOptionAllowedChannelType, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandAttachmentOption, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, ApplicationCommandType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, BaseThemeType, RESTAPIAttachment, RESTAPIMessageReference, APIMessageSharedClientTheme, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
|
|
3
3
|
import { JSONEncodable, RawFile, FileBodyEncodable, FileBodyEncodableResult } from '@discordjs/util';
|
|
4
4
|
export { RawFile } from '@discordjs/util';
|
|
5
5
|
import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
|
|
@@ -174,6 +174,22 @@ declare class PremiumButtonBuilder extends BaseButtonBuilder<APIButtonComponentW
|
|
|
174
174
|
setSKUId(skuId: Snowflake): this;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Normalizes data that is a rest parameter or an array into an array with a depth of 1.
|
|
179
|
+
*
|
|
180
|
+
* @typeParam ItemType - The data that must satisfy {@link RestOrArray}.
|
|
181
|
+
* @param arr - The (possibly variadic) data to normalize
|
|
182
|
+
*/
|
|
183
|
+
declare function normalizeArray<ItemType>(arr: RestOrArray<ItemType>): ItemType[];
|
|
184
|
+
/**
|
|
185
|
+
* Represents data that may be an array or came from a rest parameter.
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* This type is used throughout builders to ensure both an array and variadic arguments
|
|
189
|
+
* may be used. It is normalized with {@link normalizeArray}.
|
|
190
|
+
*/
|
|
191
|
+
type RestOrArray<Type> = Type[] | [Type[]];
|
|
192
|
+
|
|
177
193
|
/**
|
|
178
194
|
* A builder that creates API-compatible JSON data for file uploads.
|
|
179
195
|
*/
|
|
@@ -193,6 +209,7 @@ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent>
|
|
|
193
209
|
* custom_id: "file_upload",
|
|
194
210
|
* min_values: 2,
|
|
195
211
|
* max_values: 5,
|
|
212
|
+
* file_types: ["image", ".pdf"],
|
|
196
213
|
* });
|
|
197
214
|
* ```
|
|
198
215
|
* @example
|
|
@@ -202,7 +219,9 @@ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent>
|
|
|
202
219
|
* custom_id: "file_upload",
|
|
203
220
|
* min_values: 2,
|
|
204
221
|
* max_values: 5,
|
|
205
|
-
* })
|
|
222
|
+
* })
|
|
223
|
+
* .setFileTypes("image", ".pdf")
|
|
224
|
+
* .setRequired();
|
|
206
225
|
* ```
|
|
207
226
|
*/
|
|
208
227
|
constructor(data?: Partial<APIFileUploadComponent>);
|
|
@@ -232,6 +251,28 @@ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent>
|
|
|
232
251
|
* Clears the maximum values.
|
|
233
252
|
*/
|
|
234
253
|
clearMaxValues(): this;
|
|
254
|
+
/**
|
|
255
|
+
* Adds file types allowed in this file upload.
|
|
256
|
+
*
|
|
257
|
+
* @remarks
|
|
258
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
259
|
+
* for video uploads due to mobile platform limitations.
|
|
260
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
261
|
+
*/
|
|
262
|
+
addFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
263
|
+
/**
|
|
264
|
+
* Sets the file types allowed in this file upload.
|
|
265
|
+
*
|
|
266
|
+
* @remarks
|
|
267
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
268
|
+
* for video uploads due to mobile platform limitations.
|
|
269
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
270
|
+
*/
|
|
271
|
+
setFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
272
|
+
/**
|
|
273
|
+
* Clears the file types allowed in this file upload.
|
|
274
|
+
*/
|
|
275
|
+
clearFileTypes(): this;
|
|
235
276
|
/**
|
|
236
277
|
* Sets whether this file upload is required.
|
|
237
278
|
*
|
|
@@ -250,25 +291,14 @@ declare const fileUploadPredicate: z.ZodObject<{
|
|
|
250
291
|
custom_id: z.ZodString;
|
|
251
292
|
min_values: z.ZodOptional<z.ZodInt>;
|
|
252
293
|
max_values: z.ZodOptional<z.ZodInt>;
|
|
294
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
295
|
+
audio: "audio";
|
|
296
|
+
image: "image";
|
|
297
|
+
video: "video";
|
|
298
|
+
}>, z.ZodString]>>>;
|
|
253
299
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
254
300
|
}, z.core.$strip>;
|
|
255
301
|
|
|
256
|
-
/**
|
|
257
|
-
* Normalizes data that is a rest parameter or an array into an array with a depth of 1.
|
|
258
|
-
*
|
|
259
|
-
* @typeParam ItemType - The data that must satisfy {@link RestOrArray}.
|
|
260
|
-
* @param arr - The (possibly variadic) data to normalize
|
|
261
|
-
*/
|
|
262
|
-
declare function normalizeArray<ItemType>(arr: RestOrArray<ItemType>): ItemType[];
|
|
263
|
-
/**
|
|
264
|
-
* Represents data that may be an array or came from a rest parameter.
|
|
265
|
-
*
|
|
266
|
-
* @remarks
|
|
267
|
-
* This type is used throughout builders to ensure both an array and variadic arguments
|
|
268
|
-
* may be used. It is normalized with {@link normalizeArray}.
|
|
269
|
-
*/
|
|
270
|
-
type RestOrArray<Type> = Type[] | [Type[]];
|
|
271
|
-
|
|
272
302
|
/**
|
|
273
303
|
* The base select menu builder that contains common symbols for select menu builders.
|
|
274
304
|
*
|
|
@@ -976,6 +1006,11 @@ declare const labelPredicate: z.ZodObject<{
|
|
|
976
1006
|
custom_id: z.ZodString;
|
|
977
1007
|
min_values: z.ZodOptional<z.ZodInt>;
|
|
978
1008
|
max_values: z.ZodOptional<z.ZodInt>;
|
|
1009
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1010
|
+
audio: "audio";
|
|
1011
|
+
image: "image";
|
|
1012
|
+
video: "video";
|
|
1013
|
+
}>, z.ZodString]>>>;
|
|
979
1014
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
980
1015
|
}, z.core.$strip>]>;
|
|
981
1016
|
}, z.core.$strip>;
|
|
@@ -2348,16 +2383,47 @@ declare class ChatInputCommandAttachmentOption extends ApplicationCommandOptionB
|
|
|
2348
2383
|
*/
|
|
2349
2384
|
protected static readonly predicate: zod.ZodObject<{
|
|
2350
2385
|
type: zod.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
2386
|
+
file_types: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodEnum<{
|
|
2387
|
+
audio: "audio";
|
|
2388
|
+
image: "image";
|
|
2389
|
+
video: "video";
|
|
2390
|
+
}>, zod.ZodString]>>>;
|
|
2351
2391
|
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
2352
2392
|
name: zod.ZodString;
|
|
2353
2393
|
name_localizations: zod.ZodOptional<zod.ZodObject<Record<discord_api_types_v10.Locale, zod.ZodOptional<zod.ZodString>>, zod_v4_core.$strict>>;
|
|
2354
2394
|
description: zod.ZodString;
|
|
2355
2395
|
description_localizations: zod.ZodOptional<zod.ZodObject<Record<discord_api_types_v10.Locale, zod.ZodOptional<zod.ZodString>>, zod_v4_core.$strict>>;
|
|
2356
2396
|
}, zod_v4_core.$strip>;
|
|
2397
|
+
/**
|
|
2398
|
+
* @internal
|
|
2399
|
+
*/
|
|
2400
|
+
protected readonly data: ApplicationCommandOptionBaseData & Partial<Pick<APIApplicationCommandAttachmentOption, 'file_types'>>;
|
|
2357
2401
|
/**
|
|
2358
2402
|
* Creates a new attachment option.
|
|
2359
2403
|
*/
|
|
2360
2404
|
constructor();
|
|
2405
|
+
/**
|
|
2406
|
+
* Adds file types allowed for this attachment option.
|
|
2407
|
+
*
|
|
2408
|
+
* @remarks
|
|
2409
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
2410
|
+
* for video uploads due to mobile platform limitations.
|
|
2411
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
2412
|
+
*/
|
|
2413
|
+
addFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
2414
|
+
/**
|
|
2415
|
+
* Sets the file types allowed for this attachment option.
|
|
2416
|
+
*
|
|
2417
|
+
* @remarks
|
|
2418
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
2419
|
+
* for video uploads due to mobile platform limitations.
|
|
2420
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
2421
|
+
*/
|
|
2422
|
+
setFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
2423
|
+
/**
|
|
2424
|
+
* Clears the file types allowed for this attachment option.
|
|
2425
|
+
*/
|
|
2426
|
+
clearFileTypes(): this;
|
|
2361
2427
|
}
|
|
2362
2428
|
|
|
2363
2429
|
/**
|
|
@@ -2809,6 +2875,11 @@ declare const baseBasicOptionPredicate: z.ZodObject<{
|
|
|
2809
2875
|
}, z.core.$strip>;
|
|
2810
2876
|
declare const attachmentOptionPredicate: z.ZodObject<{
|
|
2811
2877
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
2878
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2879
|
+
audio: "audio";
|
|
2880
|
+
image: "image";
|
|
2881
|
+
video: "video";
|
|
2882
|
+
}>, z.ZodString]>>>;
|
|
2812
2883
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
2813
2884
|
name: z.ZodString;
|
|
2814
2885
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -2920,6 +2991,11 @@ declare const chatInputCommandSubcommandPredicate: z.ZodObject<{
|
|
|
2920
2991
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
2921
2992
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
2922
2993
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
2994
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2995
|
+
audio: "audio";
|
|
2996
|
+
image: "image";
|
|
2997
|
+
video: "video";
|
|
2998
|
+
}>, z.ZodString]>>>;
|
|
2923
2999
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
2924
3000
|
name: z.ZodString;
|
|
2925
3001
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3030,6 +3106,11 @@ declare const chatInputCommandSubcommandGroupPredicate: z.ZodObject<{
|
|
|
3030
3106
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
3031
3107
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3032
3108
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3109
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3110
|
+
audio: "audio";
|
|
3111
|
+
image: "image";
|
|
3112
|
+
video: "video";
|
|
3113
|
+
}>, z.ZodString]>>>;
|
|
3033
3114
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3034
3115
|
name: z.ZodString;
|
|
3035
3116
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3146,6 +3227,11 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
3146
3227
|
nsfw: z.ZodOptional<z.ZodBoolean>;
|
|
3147
3228
|
options: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3148
3229
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3230
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3231
|
+
audio: "audio";
|
|
3232
|
+
image: "image";
|
|
3233
|
+
video: "video";
|
|
3234
|
+
}>, z.ZodString]>>>;
|
|
3149
3235
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3150
3236
|
name: z.ZodString;
|
|
3151
3237
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3248,6 +3334,11 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
3248
3334
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
3249
3335
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3250
3336
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3337
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3338
|
+
audio: "audio";
|
|
3339
|
+
image: "image";
|
|
3340
|
+
video: "video";
|
|
3341
|
+
}>, z.ZodString]>>>;
|
|
3251
3342
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3252
3343
|
name: z.ZodString;
|
|
3253
3344
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3357,6 +3448,11 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
3357
3448
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
3358
3449
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3359
3450
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3451
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3452
|
+
audio: "audio";
|
|
3453
|
+
image: "image";
|
|
3454
|
+
video: "video";
|
|
3455
|
+
}>, z.ZodString]>>>;
|
|
3360
3456
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3361
3457
|
name: z.ZodString;
|
|
3362
3458
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3708,6 +3804,11 @@ declare const modalPredicate: z.ZodObject<{
|
|
|
3708
3804
|
custom_id: z.ZodString;
|
|
3709
3805
|
min_values: z.ZodOptional<z.ZodInt>;
|
|
3710
3806
|
max_values: z.ZodOptional<z.ZodInt>;
|
|
3807
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3808
|
+
audio: "audio";
|
|
3809
|
+
image: "image";
|
|
3810
|
+
video: "video";
|
|
3811
|
+
}>, z.ZodString]>>>;
|
|
3711
3812
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3712
3813
|
}, z.core.$strip>]>;
|
|
3713
3814
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -5550,6 +5651,11 @@ declare class ValidationError extends Error {
|
|
|
5550
5651
|
declare const idPredicate: z.ZodOptional<z.ZodInt>;
|
|
5551
5652
|
declare const customIdPredicate: z.ZodString;
|
|
5552
5653
|
declare const snowflakePredicate: z.ZodString;
|
|
5654
|
+
declare const fileUploadTypesPredicate: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
5655
|
+
audio: "audio";
|
|
5656
|
+
image: "image";
|
|
5657
|
+
video: "video";
|
|
5658
|
+
}>, z.ZodString]>>;
|
|
5553
5659
|
declare const memberPermissionsPredicate: z.ZodCoercedBigInt<unknown>;
|
|
5554
5660
|
declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>;
|
|
5555
5661
|
|
|
@@ -5561,4 +5667,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
|
|
|
5561
5667
|
*/
|
|
5562
5668
|
declare const version: string;
|
|
5563
5669
|
|
|
5564
|
-
export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, 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, SharedClientThemeBuilder, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentOptionPredicate, attachmentPredicate, baseBasicOptionPredicate, booleanOptionPredicate, 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, mentionableOptionPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, rawFilePredicate, resolveAccessoryComponent, resolveBuilder, roleOptionPredicate, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, sharedClientThemePredicate, snowflakePredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, userOptionPredicate, version };
|
|
5670
|
+
export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, 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, SharedClientThemeBuilder, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentOptionPredicate, attachmentPredicate, baseBasicOptionPredicate, booleanOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedPredicate, emojiPredicate, enableValidators, fileBodyMessagePredicate, filePredicate, fileUploadPredicate, fileUploadTypesPredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, mentionableOptionPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, rawFilePredicate, resolveAccessoryComponent, resolveBuilder, roleOptionPredicate, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, sharedClientThemePredicate, snowflakePredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, userOptionPredicate, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
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, ApplicationCommandOptionAllowedChannelType, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, ApplicationCommandType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, BaseThemeType, RESTAPIAttachment, RESTAPIMessageReference, APIMessageSharedClientTheme, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
|
|
2
|
+
import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APIFileUploadComponent, FileUploadType, 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, ApplicationCommandOptionAllowedChannelType, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandAttachmentOption, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, ApplicationCommandType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, BaseThemeType, RESTAPIAttachment, RESTAPIMessageReference, APIMessageSharedClientTheme, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
|
|
3
3
|
import { JSONEncodable, RawFile, FileBodyEncodable, FileBodyEncodableResult } from '@discordjs/util';
|
|
4
4
|
export { RawFile } from '@discordjs/util';
|
|
5
5
|
import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
|
|
@@ -174,6 +174,22 @@ declare class PremiumButtonBuilder extends BaseButtonBuilder<APIButtonComponentW
|
|
|
174
174
|
setSKUId(skuId: Snowflake): this;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Normalizes data that is a rest parameter or an array into an array with a depth of 1.
|
|
179
|
+
*
|
|
180
|
+
* @typeParam ItemType - The data that must satisfy {@link RestOrArray}.
|
|
181
|
+
* @param arr - The (possibly variadic) data to normalize
|
|
182
|
+
*/
|
|
183
|
+
declare function normalizeArray<ItemType>(arr: RestOrArray<ItemType>): ItemType[];
|
|
184
|
+
/**
|
|
185
|
+
* Represents data that may be an array or came from a rest parameter.
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* This type is used throughout builders to ensure both an array and variadic arguments
|
|
189
|
+
* may be used. It is normalized with {@link normalizeArray}.
|
|
190
|
+
*/
|
|
191
|
+
type RestOrArray<Type> = Type[] | [Type[]];
|
|
192
|
+
|
|
177
193
|
/**
|
|
178
194
|
* A builder that creates API-compatible JSON data for file uploads.
|
|
179
195
|
*/
|
|
@@ -193,6 +209,7 @@ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent>
|
|
|
193
209
|
* custom_id: "file_upload",
|
|
194
210
|
* min_values: 2,
|
|
195
211
|
* max_values: 5,
|
|
212
|
+
* file_types: ["image", ".pdf"],
|
|
196
213
|
* });
|
|
197
214
|
* ```
|
|
198
215
|
* @example
|
|
@@ -202,7 +219,9 @@ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent>
|
|
|
202
219
|
* custom_id: "file_upload",
|
|
203
220
|
* min_values: 2,
|
|
204
221
|
* max_values: 5,
|
|
205
|
-
* })
|
|
222
|
+
* })
|
|
223
|
+
* .setFileTypes("image", ".pdf")
|
|
224
|
+
* .setRequired();
|
|
206
225
|
* ```
|
|
207
226
|
*/
|
|
208
227
|
constructor(data?: Partial<APIFileUploadComponent>);
|
|
@@ -232,6 +251,28 @@ declare class FileUploadBuilder extends ComponentBuilder<APIFileUploadComponent>
|
|
|
232
251
|
* Clears the maximum values.
|
|
233
252
|
*/
|
|
234
253
|
clearMaxValues(): this;
|
|
254
|
+
/**
|
|
255
|
+
* Adds file types allowed in this file upload.
|
|
256
|
+
*
|
|
257
|
+
* @remarks
|
|
258
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
259
|
+
* for video uploads due to mobile platform limitations.
|
|
260
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
261
|
+
*/
|
|
262
|
+
addFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
263
|
+
/**
|
|
264
|
+
* Sets the file types allowed in this file upload.
|
|
265
|
+
*
|
|
266
|
+
* @remarks
|
|
267
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
268
|
+
* for video uploads due to mobile platform limitations.
|
|
269
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
270
|
+
*/
|
|
271
|
+
setFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
272
|
+
/**
|
|
273
|
+
* Clears the file types allowed in this file upload.
|
|
274
|
+
*/
|
|
275
|
+
clearFileTypes(): this;
|
|
235
276
|
/**
|
|
236
277
|
* Sets whether this file upload is required.
|
|
237
278
|
*
|
|
@@ -250,25 +291,14 @@ declare const fileUploadPredicate: z.ZodObject<{
|
|
|
250
291
|
custom_id: z.ZodString;
|
|
251
292
|
min_values: z.ZodOptional<z.ZodInt>;
|
|
252
293
|
max_values: z.ZodOptional<z.ZodInt>;
|
|
294
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
295
|
+
audio: "audio";
|
|
296
|
+
image: "image";
|
|
297
|
+
video: "video";
|
|
298
|
+
}>, z.ZodString]>>>;
|
|
253
299
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
254
300
|
}, z.core.$strip>;
|
|
255
301
|
|
|
256
|
-
/**
|
|
257
|
-
* Normalizes data that is a rest parameter or an array into an array with a depth of 1.
|
|
258
|
-
*
|
|
259
|
-
* @typeParam ItemType - The data that must satisfy {@link RestOrArray}.
|
|
260
|
-
* @param arr - The (possibly variadic) data to normalize
|
|
261
|
-
*/
|
|
262
|
-
declare function normalizeArray<ItemType>(arr: RestOrArray<ItemType>): ItemType[];
|
|
263
|
-
/**
|
|
264
|
-
* Represents data that may be an array or came from a rest parameter.
|
|
265
|
-
*
|
|
266
|
-
* @remarks
|
|
267
|
-
* This type is used throughout builders to ensure both an array and variadic arguments
|
|
268
|
-
* may be used. It is normalized with {@link normalizeArray}.
|
|
269
|
-
*/
|
|
270
|
-
type RestOrArray<Type> = Type[] | [Type[]];
|
|
271
|
-
|
|
272
302
|
/**
|
|
273
303
|
* The base select menu builder that contains common symbols for select menu builders.
|
|
274
304
|
*
|
|
@@ -976,6 +1006,11 @@ declare const labelPredicate: z.ZodObject<{
|
|
|
976
1006
|
custom_id: z.ZodString;
|
|
977
1007
|
min_values: z.ZodOptional<z.ZodInt>;
|
|
978
1008
|
max_values: z.ZodOptional<z.ZodInt>;
|
|
1009
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1010
|
+
audio: "audio";
|
|
1011
|
+
image: "image";
|
|
1012
|
+
video: "video";
|
|
1013
|
+
}>, z.ZodString]>>>;
|
|
979
1014
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
980
1015
|
}, z.core.$strip>]>;
|
|
981
1016
|
}, z.core.$strip>;
|
|
@@ -2348,16 +2383,47 @@ declare class ChatInputCommandAttachmentOption extends ApplicationCommandOptionB
|
|
|
2348
2383
|
*/
|
|
2349
2384
|
protected static readonly predicate: zod.ZodObject<{
|
|
2350
2385
|
type: zod.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
2386
|
+
file_types: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodEnum<{
|
|
2387
|
+
audio: "audio";
|
|
2388
|
+
image: "image";
|
|
2389
|
+
video: "video";
|
|
2390
|
+
}>, zod.ZodString]>>>;
|
|
2351
2391
|
required: zod.ZodOptional<zod.ZodBoolean>;
|
|
2352
2392
|
name: zod.ZodString;
|
|
2353
2393
|
name_localizations: zod.ZodOptional<zod.ZodObject<Record<discord_api_types_v10.Locale, zod.ZodOptional<zod.ZodString>>, zod_v4_core.$strict>>;
|
|
2354
2394
|
description: zod.ZodString;
|
|
2355
2395
|
description_localizations: zod.ZodOptional<zod.ZodObject<Record<discord_api_types_v10.Locale, zod.ZodOptional<zod.ZodString>>, zod_v4_core.$strict>>;
|
|
2356
2396
|
}, zod_v4_core.$strip>;
|
|
2397
|
+
/**
|
|
2398
|
+
* @internal
|
|
2399
|
+
*/
|
|
2400
|
+
protected readonly data: ApplicationCommandOptionBaseData & Partial<Pick<APIApplicationCommandAttachmentOption, 'file_types'>>;
|
|
2357
2401
|
/**
|
|
2358
2402
|
* Creates a new attachment option.
|
|
2359
2403
|
*/
|
|
2360
2404
|
constructor();
|
|
2405
|
+
/**
|
|
2406
|
+
* Adds file types allowed for this attachment option.
|
|
2407
|
+
*
|
|
2408
|
+
* @remarks
|
|
2409
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
2410
|
+
* for video uploads due to mobile platform limitations.
|
|
2411
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
2412
|
+
*/
|
|
2413
|
+
addFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
2414
|
+
/**
|
|
2415
|
+
* Sets the file types allowed for this attachment option.
|
|
2416
|
+
*
|
|
2417
|
+
* @remarks
|
|
2418
|
+
* When specifying only extensions, include `.jpg` for image uploads and both `.mp4` and `.mov`
|
|
2419
|
+
* for video uploads due to mobile platform limitations.
|
|
2420
|
+
* @param fileTypes - The file groups or dot-prefixed extensions to allow
|
|
2421
|
+
*/
|
|
2422
|
+
setFileTypes(...fileTypes: RestOrArray<FileUploadType>): this;
|
|
2423
|
+
/**
|
|
2424
|
+
* Clears the file types allowed for this attachment option.
|
|
2425
|
+
*/
|
|
2426
|
+
clearFileTypes(): this;
|
|
2361
2427
|
}
|
|
2362
2428
|
|
|
2363
2429
|
/**
|
|
@@ -2809,6 +2875,11 @@ declare const baseBasicOptionPredicate: z.ZodObject<{
|
|
|
2809
2875
|
}, z.core.$strip>;
|
|
2810
2876
|
declare const attachmentOptionPredicate: z.ZodObject<{
|
|
2811
2877
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
2878
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2879
|
+
audio: "audio";
|
|
2880
|
+
image: "image";
|
|
2881
|
+
video: "video";
|
|
2882
|
+
}>, z.ZodString]>>>;
|
|
2812
2883
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
2813
2884
|
name: z.ZodString;
|
|
2814
2885
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -2920,6 +2991,11 @@ declare const chatInputCommandSubcommandPredicate: z.ZodObject<{
|
|
|
2920
2991
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
2921
2992
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
2922
2993
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
2994
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
2995
|
+
audio: "audio";
|
|
2996
|
+
image: "image";
|
|
2997
|
+
video: "video";
|
|
2998
|
+
}>, z.ZodString]>>>;
|
|
2923
2999
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
2924
3000
|
name: z.ZodString;
|
|
2925
3001
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3030,6 +3106,11 @@ declare const chatInputCommandSubcommandGroupPredicate: z.ZodObject<{
|
|
|
3030
3106
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
3031
3107
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3032
3108
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3109
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3110
|
+
audio: "audio";
|
|
3111
|
+
image: "image";
|
|
3112
|
+
video: "video";
|
|
3113
|
+
}>, z.ZodString]>>>;
|
|
3033
3114
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3034
3115
|
name: z.ZodString;
|
|
3035
3116
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3146,6 +3227,11 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
3146
3227
|
nsfw: z.ZodOptional<z.ZodBoolean>;
|
|
3147
3228
|
options: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3148
3229
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3230
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3231
|
+
audio: "audio";
|
|
3232
|
+
image: "image";
|
|
3233
|
+
video: "video";
|
|
3234
|
+
}>, z.ZodString]>>>;
|
|
3149
3235
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3150
3236
|
name: z.ZodString;
|
|
3151
3237
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3248,6 +3334,11 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
3248
3334
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
3249
3335
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3250
3336
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3337
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3338
|
+
audio: "audio";
|
|
3339
|
+
image: "image";
|
|
3340
|
+
video: "video";
|
|
3341
|
+
}>, z.ZodString]>>>;
|
|
3251
3342
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3252
3343
|
name: z.ZodString;
|
|
3253
3344
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3357,6 +3448,11 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
3357
3448
|
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
3358
3449
|
options: z.ZodOptional<z.ZodArray<z.ZodUnion<(z.ZodObject<{
|
|
3359
3450
|
type: z.ZodLiteral<ApplicationCommandOptionType.Attachment>;
|
|
3451
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3452
|
+
audio: "audio";
|
|
3453
|
+
image: "image";
|
|
3454
|
+
video: "video";
|
|
3455
|
+
}>, z.ZodString]>>>;
|
|
3360
3456
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3361
3457
|
name: z.ZodString;
|
|
3362
3458
|
name_localizations: z.ZodOptional<z.ZodObject<Record<discord_api_types_v10.Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>>;
|
|
@@ -3708,6 +3804,11 @@ declare const modalPredicate: z.ZodObject<{
|
|
|
3708
3804
|
custom_id: z.ZodString;
|
|
3709
3805
|
min_values: z.ZodOptional<z.ZodInt>;
|
|
3710
3806
|
max_values: z.ZodOptional<z.ZodInt>;
|
|
3807
|
+
file_types: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
3808
|
+
audio: "audio";
|
|
3809
|
+
image: "image";
|
|
3810
|
+
video: "video";
|
|
3811
|
+
}>, z.ZodString]>>>;
|
|
3711
3812
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3712
3813
|
}, z.core.$strip>]>;
|
|
3713
3814
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -5550,6 +5651,11 @@ declare class ValidationError extends Error {
|
|
|
5550
5651
|
declare const idPredicate: z.ZodOptional<z.ZodInt>;
|
|
5551
5652
|
declare const customIdPredicate: z.ZodString;
|
|
5552
5653
|
declare const snowflakePredicate: z.ZodString;
|
|
5654
|
+
declare const fileUploadTypesPredicate: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
5655
|
+
audio: "audio";
|
|
5656
|
+
image: "image";
|
|
5657
|
+
video: "video";
|
|
5658
|
+
}>, z.ZodString]>>;
|
|
5553
5659
|
declare const memberPermissionsPredicate: z.ZodCoercedBigInt<unknown>;
|
|
5554
5660
|
declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>;
|
|
5555
5661
|
|
|
@@ -5561,4 +5667,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
|
|
|
5561
5667
|
*/
|
|
5562
5668
|
declare const version: string;
|
|
5563
5669
|
|
|
5564
|
-
export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, 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, SharedClientThemeBuilder, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentOptionPredicate, attachmentPredicate, baseBasicOptionPredicate, booleanOptionPredicate, 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, mentionableOptionPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, rawFilePredicate, resolveAccessoryComponent, resolveBuilder, roleOptionPredicate, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, sharedClientThemePredicate, snowflakePredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, userOptionPredicate, version };
|
|
5670
|
+
export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, 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, SharedClientThemeBuilder, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentOptionPredicate, attachmentPredicate, baseBasicOptionPredicate, booleanOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedPredicate, emojiPredicate, enableValidators, fileBodyMessagePredicate, filePredicate, fileUploadPredicate, fileUploadTypesPredicate, idPredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, mentionableOptionPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, rawFilePredicate, resolveAccessoryComponent, resolveBuilder, roleOptionPredicate, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, sharedClientThemePredicate, snowflakePredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, userOptionPredicate, version };
|