@discordjs/builders 2.0.0-pr-11006.1765452229-e636950b2 → 2.0.0-pr-11005.1765454364-f3f6d34e7
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 +20 -197
- package/dist/index.d.ts +20 -197
- package/dist/index.js +36 -141
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -137
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
2
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
|
|
4
|
-
export { RawFile } from '@discordjs/util';
|
|
3
|
+
import { JSONEncodable } from '@discordjs/util';
|
|
5
4
|
import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
|
|
6
5
|
import * as zod from 'zod';
|
|
7
6
|
import { z } from 'zod';
|
|
8
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
9
|
-
import { Buffer } from 'node:buffer';
|
|
10
8
|
|
|
11
9
|
interface EmojiOrLabelButtonData extends Pick<Exclude<APIButtonComponent, APIButtonComponentWithSKUId>, 'emoji' | 'label'> {
|
|
12
10
|
}
|
|
@@ -1854,7 +1852,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1854
1852
|
name: z.ZodOptional<z.ZodString>;
|
|
1855
1853
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
1856
1854
|
}, z.core.$strict>>;
|
|
1857
|
-
label: z.
|
|
1855
|
+
label: z.ZodString;
|
|
1858
1856
|
}, z.core.$strict>, z.ZodObject<{
|
|
1859
1857
|
type: z.ZodLiteral<ComponentType.Button>;
|
|
1860
1858
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1864,7 +1862,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1864
1862
|
name: z.ZodOptional<z.ZodString>;
|
|
1865
1863
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
1866
1864
|
}, z.core.$strict>>;
|
|
1867
|
-
label: z.
|
|
1865
|
+
label: z.ZodString;
|
|
1868
1866
|
style: z.ZodLiteral<ButtonStyle.Primary>;
|
|
1869
1867
|
}, z.core.$strict>, z.ZodObject<{
|
|
1870
1868
|
type: z.ZodLiteral<ComponentType.Button>;
|
|
@@ -1875,7 +1873,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1875
1873
|
name: z.ZodOptional<z.ZodString>;
|
|
1876
1874
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
1877
1875
|
}, z.core.$strict>>;
|
|
1878
|
-
label: z.
|
|
1876
|
+
label: z.ZodString;
|
|
1879
1877
|
style: z.ZodLiteral<ButtonStyle.Secondary>;
|
|
1880
1878
|
}, z.core.$strict>, z.ZodObject<{
|
|
1881
1879
|
type: z.ZodLiteral<ComponentType.Button>;
|
|
@@ -1886,7 +1884,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1886
1884
|
name: z.ZodOptional<z.ZodString>;
|
|
1887
1885
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
1888
1886
|
}, z.core.$strict>>;
|
|
1889
|
-
label: z.
|
|
1887
|
+
label: z.ZodString;
|
|
1890
1888
|
style: z.ZodLiteral<ButtonStyle.Success>;
|
|
1891
1889
|
}, z.core.$strict>, z.ZodObject<{
|
|
1892
1890
|
type: z.ZodLiteral<ComponentType.Button>;
|
|
@@ -1897,7 +1895,7 @@ declare const buttonPredicate: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1897
1895
|
name: z.ZodOptional<z.ZodString>;
|
|
1898
1896
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
1899
1897
|
}, z.core.$strict>>;
|
|
1900
|
-
label: z.
|
|
1898
|
+
label: z.ZodString;
|
|
1901
1899
|
style: z.ZodLiteral<ButtonStyle.Danger>;
|
|
1902
1900
|
}, z.core.$strict>, z.ZodObject<{
|
|
1903
1901
|
type: z.ZodLiteral<ComponentType.Button>;
|
|
@@ -2838,7 +2836,9 @@ declare const chatInputCommandPredicate: z.ZodObject<{
|
|
|
2838
2836
|
options: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
2839
2837
|
type: z.ZodLiteral<ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Boolean | ApplicationCommandOptionType.User | ApplicationCommandOptionType.Channel | ApplicationCommandOptionType.Role | ApplicationCommandOptionType.Mentionable | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Attachment>;
|
|
2840
2838
|
}, z.core.$strip>>, z.ZodArray<z.ZodObject<{
|
|
2841
|
-
type: z.
|
|
2839
|
+
type: z.ZodLiteral<ApplicationCommandOptionType.Subcommand>;
|
|
2840
|
+
}, z.core.$strip>>, z.ZodArray<z.ZodObject<{
|
|
2841
|
+
type: z.ZodLiteral<ApplicationCommandOptionType.SubcommandGroup>;
|
|
2842
2842
|
}, z.core.$strip>>]>>;
|
|
2843
2843
|
}, z.core.$strip>;
|
|
2844
2844
|
declare const chatInputCommandSubcommandGroupPredicate: z.ZodObject<{
|
|
@@ -3982,12 +3982,6 @@ declare class AllowedMentionsBuilder implements JSONEncodable<APIAllowedMentions
|
|
|
3982
3982
|
toJSON(validationOverride?: boolean): APIAllowedMentions;
|
|
3983
3983
|
}
|
|
3984
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>;
|
|
3991
3985
|
declare const attachmentPredicate: z.ZodObject<{
|
|
3992
3986
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
3993
3987
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -4127,132 +4121,6 @@ declare const messagePredicate: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
4127
4121
|
sticker_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNever>>>;
|
|
4128
4122
|
poll: z.ZodOptional<z.ZodNull>;
|
|
4129
4123
|
}, 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>;
|
|
4256
4124
|
|
|
4257
4125
|
/**
|
|
4258
4126
|
* A builder that creates API-compatible JSON data for attachments.
|
|
@@ -4262,25 +4130,10 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
|
|
|
4262
4130
|
* The API data associated with this attachment.
|
|
4263
4131
|
*/
|
|
4264
4132
|
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;
|
|
4275
4133
|
/**
|
|
4276
4134
|
* Creates a new attachment builder.
|
|
4277
4135
|
*
|
|
4278
4136
|
* @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!
|
|
4284
4137
|
*/
|
|
4285
4138
|
constructor(data?: Partial<RESTAPIAttachment>);
|
|
4286
4139
|
/**
|
|
@@ -4288,7 +4141,7 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
|
|
|
4288
4141
|
*
|
|
4289
4142
|
* @param id - The id of the attachment
|
|
4290
4143
|
*/
|
|
4291
|
-
setId(id: Snowflake
|
|
4144
|
+
setId(id: Snowflake): this;
|
|
4292
4145
|
/**
|
|
4293
4146
|
* Sets the description of this attachment.
|
|
4294
4147
|
*
|
|
@@ -4319,33 +4172,6 @@ declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment> {
|
|
|
4319
4172
|
* Clears the filename of this attachment.
|
|
4320
4173
|
*/
|
|
4321
4174
|
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;
|
|
4349
4175
|
/**
|
|
4350
4176
|
* Sets the title of this attachment.
|
|
4351
4177
|
*
|
|
@@ -4453,7 +4279,7 @@ interface MessageBuilderData extends Partial<Omit<RESTPostAPIChannelMessageJSONB
|
|
|
4453
4279
|
/**
|
|
4454
4280
|
* A builder that creates API-compatible JSON data for messages.
|
|
4455
4281
|
*/
|
|
4456
|
-
declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJSONBody
|
|
4282
|
+
declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJSONBody> {
|
|
4457
4283
|
/**
|
|
4458
4284
|
* The API data associated with this message.
|
|
4459
4285
|
*/
|
|
@@ -4566,7 +4392,7 @@ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJ
|
|
|
4566
4392
|
*
|
|
4567
4393
|
* @param allowedMentions - The allowed mentions to set
|
|
4568
4394
|
*/
|
|
4569
|
-
setAllowedMentions(allowedMentions
|
|
4395
|
+
setAllowedMentions(allowedMentions: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)): this;
|
|
4570
4396
|
/**
|
|
4571
4397
|
* Updates the allowed mentions for this message (and creates it if it doesn't exist)
|
|
4572
4398
|
*
|
|
@@ -4786,17 +4612,15 @@ declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJ
|
|
|
4786
4612
|
* @param validationOverride - Force validation to run/not run regardless of your global preference
|
|
4787
4613
|
*/
|
|
4788
4614
|
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>;
|
|
4798
4615
|
}
|
|
4799
4616
|
|
|
4617
|
+
/**
|
|
4618
|
+
* Calculates the length of the embed.
|
|
4619
|
+
*
|
|
4620
|
+
* @param data - The embed data to check
|
|
4621
|
+
*/
|
|
4622
|
+
declare function embedLength(data: APIEmbed): number;
|
|
4623
|
+
|
|
4800
4624
|
/**
|
|
4801
4625
|
* "Resolves" a builder from the 3 ways it can be input:
|
|
4802
4626
|
* 1. A clean instance
|
|
@@ -4843,7 +4667,6 @@ declare class ValidationError extends Error {
|
|
|
4843
4667
|
|
|
4844
4668
|
declare const idPredicate: z.ZodOptional<z.ZodInt>;
|
|
4845
4669
|
declare const customIdPredicate: z.ZodString;
|
|
4846
|
-
declare const snowflakePredicate: z.ZodString;
|
|
4847
4670
|
declare const memberPermissionsPredicate: z.ZodCoercedBigInt<unknown>;
|
|
4848
4671
|
declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.ZodString>>, z.core.$strict>;
|
|
4849
4672
|
|
|
@@ -4855,4 +4678,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
|
|
|
4855
4678
|
*/
|
|
4856
4679
|
declare const version: string;
|
|
4857
4680
|
|
|
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,
|
|
4681
|
+
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, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, fileUploadPredicate, 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 };
|