@discordjs/builders 2.0.0-dev.1740701547-b6fda781c → 2.0.0-dev.1740744295-88bfeaab2
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 +441 -2
- package/dist/index.d.ts +441 -2
- package/dist/index.js +340 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +330 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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, APIActionRowComponent, APIActionRowComponentTypes, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, ComponentType, APIModalComponent, APIMessageComponent, ButtonStyle, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIModalActionRowComponent, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed } from 'discord-api-types/v10';
|
|
2
|
+
import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIActionRowComponent, APIActionRowComponentTypes, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, ComponentType, APIModalComponent, APIMessageComponent, ButtonStyle, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIModalActionRowComponent, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll } from 'discord-api-types/v10';
|
|
3
3
|
import { JSONEncodable } from '@discordjs/util';
|
|
4
4
|
import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
|
|
5
5
|
import * as zod from 'zod';
|
|
@@ -8160,6 +8160,432 @@ declare class EmbedBuilder implements JSONEncodable<APIEmbed> {
|
|
|
8160
8160
|
toJSON(validationOverride?: boolean): APIEmbed;
|
|
8161
8161
|
}
|
|
8162
8162
|
|
|
8163
|
+
declare const pollQuestionPredicate: z.ZodObject<{
|
|
8164
|
+
text: z.ZodString;
|
|
8165
|
+
}, "strip", z.ZodTypeAny, {
|
|
8166
|
+
text: string;
|
|
8167
|
+
}, {
|
|
8168
|
+
text: string;
|
|
8169
|
+
}>;
|
|
8170
|
+
declare const pollAnswerMediaPredicate: z.ZodObject<{
|
|
8171
|
+
text: z.ZodString;
|
|
8172
|
+
emoji: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
|
|
8173
|
+
id: z.ZodOptional<z.ZodString>;
|
|
8174
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8175
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
8176
|
+
}, "strict", z.ZodTypeAny, {
|
|
8177
|
+
id?: string | undefined;
|
|
8178
|
+
name?: string | undefined;
|
|
8179
|
+
animated?: boolean | undefined;
|
|
8180
|
+
}, {
|
|
8181
|
+
id?: string | undefined;
|
|
8182
|
+
name?: string | undefined;
|
|
8183
|
+
animated?: boolean | undefined;
|
|
8184
|
+
}>, {
|
|
8185
|
+
id?: string | undefined;
|
|
8186
|
+
name?: string | undefined;
|
|
8187
|
+
animated?: boolean | undefined;
|
|
8188
|
+
}, {
|
|
8189
|
+
id?: string | undefined;
|
|
8190
|
+
name?: string | undefined;
|
|
8191
|
+
animated?: boolean | undefined;
|
|
8192
|
+
}>>>;
|
|
8193
|
+
}, "strip", z.ZodTypeAny, {
|
|
8194
|
+
text: string;
|
|
8195
|
+
emoji?: {
|
|
8196
|
+
id?: string | undefined;
|
|
8197
|
+
name?: string | undefined;
|
|
8198
|
+
animated?: boolean | undefined;
|
|
8199
|
+
} | null | undefined;
|
|
8200
|
+
}, {
|
|
8201
|
+
text: string;
|
|
8202
|
+
emoji?: {
|
|
8203
|
+
id?: string | undefined;
|
|
8204
|
+
name?: string | undefined;
|
|
8205
|
+
animated?: boolean | undefined;
|
|
8206
|
+
} | null | undefined;
|
|
8207
|
+
}>;
|
|
8208
|
+
declare const pollAnswerPredicate: z.ZodObject<{
|
|
8209
|
+
poll_media: z.ZodObject<{
|
|
8210
|
+
text: z.ZodString;
|
|
8211
|
+
emoji: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
|
|
8212
|
+
id: z.ZodOptional<z.ZodString>;
|
|
8213
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8214
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
8215
|
+
}, "strict", z.ZodTypeAny, {
|
|
8216
|
+
id?: string | undefined;
|
|
8217
|
+
name?: string | undefined;
|
|
8218
|
+
animated?: boolean | undefined;
|
|
8219
|
+
}, {
|
|
8220
|
+
id?: string | undefined;
|
|
8221
|
+
name?: string | undefined;
|
|
8222
|
+
animated?: boolean | undefined;
|
|
8223
|
+
}>, {
|
|
8224
|
+
id?: string | undefined;
|
|
8225
|
+
name?: string | undefined;
|
|
8226
|
+
animated?: boolean | undefined;
|
|
8227
|
+
}, {
|
|
8228
|
+
id?: string | undefined;
|
|
8229
|
+
name?: string | undefined;
|
|
8230
|
+
animated?: boolean | undefined;
|
|
8231
|
+
}>>>;
|
|
8232
|
+
}, "strip", z.ZodTypeAny, {
|
|
8233
|
+
text: string;
|
|
8234
|
+
emoji?: {
|
|
8235
|
+
id?: string | undefined;
|
|
8236
|
+
name?: string | undefined;
|
|
8237
|
+
animated?: boolean | undefined;
|
|
8238
|
+
} | null | undefined;
|
|
8239
|
+
}, {
|
|
8240
|
+
text: string;
|
|
8241
|
+
emoji?: {
|
|
8242
|
+
id?: string | undefined;
|
|
8243
|
+
name?: string | undefined;
|
|
8244
|
+
animated?: boolean | undefined;
|
|
8245
|
+
} | null | undefined;
|
|
8246
|
+
}>;
|
|
8247
|
+
}, "strip", z.ZodTypeAny, {
|
|
8248
|
+
poll_media: {
|
|
8249
|
+
text: string;
|
|
8250
|
+
emoji?: {
|
|
8251
|
+
id?: string | undefined;
|
|
8252
|
+
name?: string | undefined;
|
|
8253
|
+
animated?: boolean | undefined;
|
|
8254
|
+
} | null | undefined;
|
|
8255
|
+
};
|
|
8256
|
+
}, {
|
|
8257
|
+
poll_media: {
|
|
8258
|
+
text: string;
|
|
8259
|
+
emoji?: {
|
|
8260
|
+
id?: string | undefined;
|
|
8261
|
+
name?: string | undefined;
|
|
8262
|
+
animated?: boolean | undefined;
|
|
8263
|
+
} | null | undefined;
|
|
8264
|
+
};
|
|
8265
|
+
}>;
|
|
8266
|
+
declare const pollPredicate: z.ZodObject<{
|
|
8267
|
+
question: z.ZodObject<{
|
|
8268
|
+
text: z.ZodString;
|
|
8269
|
+
}, "strip", z.ZodTypeAny, {
|
|
8270
|
+
text: string;
|
|
8271
|
+
}, {
|
|
8272
|
+
text: string;
|
|
8273
|
+
}>;
|
|
8274
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
8275
|
+
poll_media: z.ZodObject<{
|
|
8276
|
+
text: z.ZodString;
|
|
8277
|
+
emoji: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
|
|
8278
|
+
id: z.ZodOptional<z.ZodString>;
|
|
8279
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8280
|
+
animated: z.ZodOptional<z.ZodBoolean>;
|
|
8281
|
+
}, "strict", z.ZodTypeAny, {
|
|
8282
|
+
id?: string | undefined;
|
|
8283
|
+
name?: string | undefined;
|
|
8284
|
+
animated?: boolean | undefined;
|
|
8285
|
+
}, {
|
|
8286
|
+
id?: string | undefined;
|
|
8287
|
+
name?: string | undefined;
|
|
8288
|
+
animated?: boolean | undefined;
|
|
8289
|
+
}>, {
|
|
8290
|
+
id?: string | undefined;
|
|
8291
|
+
name?: string | undefined;
|
|
8292
|
+
animated?: boolean | undefined;
|
|
8293
|
+
}, {
|
|
8294
|
+
id?: string | undefined;
|
|
8295
|
+
name?: string | undefined;
|
|
8296
|
+
animated?: boolean | undefined;
|
|
8297
|
+
}>>>;
|
|
8298
|
+
}, "strip", z.ZodTypeAny, {
|
|
8299
|
+
text: string;
|
|
8300
|
+
emoji?: {
|
|
8301
|
+
id?: string | undefined;
|
|
8302
|
+
name?: string | undefined;
|
|
8303
|
+
animated?: boolean | undefined;
|
|
8304
|
+
} | null | undefined;
|
|
8305
|
+
}, {
|
|
8306
|
+
text: string;
|
|
8307
|
+
emoji?: {
|
|
8308
|
+
id?: string | undefined;
|
|
8309
|
+
name?: string | undefined;
|
|
8310
|
+
animated?: boolean | undefined;
|
|
8311
|
+
} | null | undefined;
|
|
8312
|
+
}>;
|
|
8313
|
+
}, "strip", z.ZodTypeAny, {
|
|
8314
|
+
poll_media: {
|
|
8315
|
+
text: string;
|
|
8316
|
+
emoji?: {
|
|
8317
|
+
id?: string | undefined;
|
|
8318
|
+
name?: string | undefined;
|
|
8319
|
+
animated?: boolean | undefined;
|
|
8320
|
+
} | null | undefined;
|
|
8321
|
+
};
|
|
8322
|
+
}, {
|
|
8323
|
+
poll_media: {
|
|
8324
|
+
text: string;
|
|
8325
|
+
emoji?: {
|
|
8326
|
+
id?: string | undefined;
|
|
8327
|
+
name?: string | undefined;
|
|
8328
|
+
animated?: boolean | undefined;
|
|
8329
|
+
} | null | undefined;
|
|
8330
|
+
};
|
|
8331
|
+
}>, "many">;
|
|
8332
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
8333
|
+
allow_multiselect: z.ZodOptional<z.ZodBoolean>;
|
|
8334
|
+
layout_type: z.ZodOptional<z.ZodNativeEnum<typeof PollLayoutType>>;
|
|
8335
|
+
}, "strip", z.ZodTypeAny, {
|
|
8336
|
+
question: {
|
|
8337
|
+
text: string;
|
|
8338
|
+
};
|
|
8339
|
+
answers: {
|
|
8340
|
+
poll_media: {
|
|
8341
|
+
text: string;
|
|
8342
|
+
emoji?: {
|
|
8343
|
+
id?: string | undefined;
|
|
8344
|
+
name?: string | undefined;
|
|
8345
|
+
animated?: boolean | undefined;
|
|
8346
|
+
} | null | undefined;
|
|
8347
|
+
};
|
|
8348
|
+
}[];
|
|
8349
|
+
duration?: number | undefined;
|
|
8350
|
+
allow_multiselect?: boolean | undefined;
|
|
8351
|
+
layout_type?: PollLayoutType | undefined;
|
|
8352
|
+
}, {
|
|
8353
|
+
question: {
|
|
8354
|
+
text: string;
|
|
8355
|
+
};
|
|
8356
|
+
answers: {
|
|
8357
|
+
poll_media: {
|
|
8358
|
+
text: string;
|
|
8359
|
+
emoji?: {
|
|
8360
|
+
id?: string | undefined;
|
|
8361
|
+
name?: string | undefined;
|
|
8362
|
+
animated?: boolean | undefined;
|
|
8363
|
+
} | null | undefined;
|
|
8364
|
+
};
|
|
8365
|
+
}[];
|
|
8366
|
+
duration?: number | undefined;
|
|
8367
|
+
allow_multiselect?: boolean | undefined;
|
|
8368
|
+
layout_type?: PollLayoutType | undefined;
|
|
8369
|
+
}>;
|
|
8370
|
+
|
|
8371
|
+
declare abstract class PollMediaBuilder {
|
|
8372
|
+
protected readonly data: Partial<APIPollMedia>;
|
|
8373
|
+
/**
|
|
8374
|
+
* Creates new poll media from API data.
|
|
8375
|
+
*
|
|
8376
|
+
* @param data - The API data to use
|
|
8377
|
+
*/
|
|
8378
|
+
constructor(data?: Partial<APIPollMedia>);
|
|
8379
|
+
/**
|
|
8380
|
+
* Sets the text for this poll media.
|
|
8381
|
+
*
|
|
8382
|
+
* @param text - The text to use
|
|
8383
|
+
*/
|
|
8384
|
+
setText(text: string): this;
|
|
8385
|
+
/**
|
|
8386
|
+
* Serializes this builder to API-compatible JSON data.
|
|
8387
|
+
*
|
|
8388
|
+
* Note that by disabling validation, there is no guarantee that the resulting object will be valid.
|
|
8389
|
+
*
|
|
8390
|
+
* @param validationOverride - Force validation to run/not run regardless of your global preference
|
|
8391
|
+
*/
|
|
8392
|
+
abstract toJSON(validationOverride?: boolean): APIPollMedia;
|
|
8393
|
+
}
|
|
8394
|
+
|
|
8395
|
+
/**
|
|
8396
|
+
* A builder that creates API-compatible JSON data for poll answers.
|
|
8397
|
+
*/
|
|
8398
|
+
declare class PollAnswerMediaBuilder extends PollMediaBuilder {
|
|
8399
|
+
/**
|
|
8400
|
+
* Sets the emoji for this poll answer.
|
|
8401
|
+
*
|
|
8402
|
+
* @param emoji - The emoji to use
|
|
8403
|
+
*/
|
|
8404
|
+
setEmoji(emoji: APIPartialEmoji): this;
|
|
8405
|
+
/**
|
|
8406
|
+
* Clears the emoji for this poll answer.
|
|
8407
|
+
*/
|
|
8408
|
+
clearEmoji(): this;
|
|
8409
|
+
toJSON(validationOverride?: boolean): APIPollMedia;
|
|
8410
|
+
}
|
|
8411
|
+
|
|
8412
|
+
interface PollAnswerData extends Omit<APIPollAnswer, 'answer_id' | 'poll_media'> {
|
|
8413
|
+
poll_media: PollAnswerMediaBuilder;
|
|
8414
|
+
}
|
|
8415
|
+
declare class PollAnswerBuilder {
|
|
8416
|
+
protected readonly data: PollAnswerData;
|
|
8417
|
+
constructor(data?: Partial<Omit<APIPollAnswer, 'answer_id'>>);
|
|
8418
|
+
/**
|
|
8419
|
+
* Sets the media for this poll answer.
|
|
8420
|
+
*
|
|
8421
|
+
* @param options - The data to use for this poll answer's media
|
|
8422
|
+
*/
|
|
8423
|
+
setMedia(options: APIPollMedia | PollAnswerMediaBuilder | ((builder: PollAnswerMediaBuilder) => PollAnswerMediaBuilder)): this;
|
|
8424
|
+
/**
|
|
8425
|
+
* Updates the media of this poll answer.
|
|
8426
|
+
*
|
|
8427
|
+
* @param updater - The function to update the media with
|
|
8428
|
+
*/
|
|
8429
|
+
updateMedia(updater: (builder: PollAnswerMediaBuilder) => void): void;
|
|
8430
|
+
/**
|
|
8431
|
+
* Serializes this builder to API-compatible JSON data.
|
|
8432
|
+
*
|
|
8433
|
+
* Note that by disabling validation, there is no guarantee that the resulting object will be valid.
|
|
8434
|
+
*
|
|
8435
|
+
* @param validationOverride - Force validation to run/not run regardless of your global preference
|
|
8436
|
+
*/
|
|
8437
|
+
toJSON(validationOverride?: boolean): Omit<APIPollAnswer, 'answer_id'>;
|
|
8438
|
+
}
|
|
8439
|
+
|
|
8440
|
+
/**
|
|
8441
|
+
* A builder that creates API-compatible JSON data for a poll question.
|
|
8442
|
+
*/
|
|
8443
|
+
declare class PollQuestionBuilder extends PollMediaBuilder {
|
|
8444
|
+
toJSON(validationOverride?: boolean): Omit<APIPollMedia, 'emoji'>;
|
|
8445
|
+
}
|
|
8446
|
+
|
|
8447
|
+
interface PollData extends Omit<RESTAPIPoll, 'answers' | 'question'> {
|
|
8448
|
+
answers: PollAnswerBuilder[];
|
|
8449
|
+
question: PollQuestionBuilder;
|
|
8450
|
+
}
|
|
8451
|
+
/**
|
|
8452
|
+
* A builder that creates API-compatible JSON data for polls.
|
|
8453
|
+
*/
|
|
8454
|
+
declare class PollBuilder implements JSONEncodable<RESTAPIPoll> {
|
|
8455
|
+
/**
|
|
8456
|
+
* The API data associated with this poll.
|
|
8457
|
+
*/
|
|
8458
|
+
private readonly data;
|
|
8459
|
+
/**
|
|
8460
|
+
* Gets the answers of this poll.
|
|
8461
|
+
*/
|
|
8462
|
+
get answers(): readonly PollAnswerBuilder[];
|
|
8463
|
+
/**
|
|
8464
|
+
* Creates a new poll from API data.
|
|
8465
|
+
*
|
|
8466
|
+
* @param data - The API data to create this poll with
|
|
8467
|
+
*/
|
|
8468
|
+
constructor(data?: Partial<RESTAPIPoll>);
|
|
8469
|
+
/**
|
|
8470
|
+
* Appends answers to the poll.
|
|
8471
|
+
*
|
|
8472
|
+
* @remarks
|
|
8473
|
+
* This method accepts either an array of answers or a variable number of answer parameters.
|
|
8474
|
+
* The maximum amount of answers that can be added is 10.
|
|
8475
|
+
* @example
|
|
8476
|
+
* Using an array:
|
|
8477
|
+
* ```ts
|
|
8478
|
+
* const answers: APIPollMedia[] = ...;
|
|
8479
|
+
* const poll = new PollBuilder()
|
|
8480
|
+
* .addAnswers(answers);
|
|
8481
|
+
* ```
|
|
8482
|
+
* @example
|
|
8483
|
+
* Using rest parameters (variadic):
|
|
8484
|
+
* ```ts
|
|
8485
|
+
* const poll = new PollBuilder()
|
|
8486
|
+
* .addAnswers(
|
|
8487
|
+
* { text: 'Answer 1' },
|
|
8488
|
+
* { text: 'Answer 2' },
|
|
8489
|
+
* );
|
|
8490
|
+
* ```
|
|
8491
|
+
* @param answers - The answers to add
|
|
8492
|
+
*/
|
|
8493
|
+
addAnswers(...answers: RestOrArray<Omit<APIPollAnswer, 'answer_id'> | PollAnswerBuilder | ((builder: PollAnswerBuilder) => PollAnswerBuilder)>): this;
|
|
8494
|
+
/**
|
|
8495
|
+
* Removes, replaces, or inserts answers for this poll.
|
|
8496
|
+
*
|
|
8497
|
+
* @remarks
|
|
8498
|
+
* This method behaves similarly
|
|
8499
|
+
* to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
|
|
8500
|
+
* The maximum amount of answers that can be added is 10.
|
|
8501
|
+
*
|
|
8502
|
+
* It's useful for modifying and adjusting order of the already-existing answers of a poll.
|
|
8503
|
+
* @example
|
|
8504
|
+
* Remove the first answer:
|
|
8505
|
+
* ```ts
|
|
8506
|
+
* poll.spliceAnswers(0, 1);
|
|
8507
|
+
* ```
|
|
8508
|
+
* @example
|
|
8509
|
+
* Remove the first n answers:
|
|
8510
|
+
* ```ts
|
|
8511
|
+
* const n = 4;
|
|
8512
|
+
* poll.spliceAnswers(0, n);
|
|
8513
|
+
* ```
|
|
8514
|
+
* @example
|
|
8515
|
+
* Remove the last answer:
|
|
8516
|
+
* ```ts
|
|
8517
|
+
* poll.spliceAnswers(-1, 1);
|
|
8518
|
+
* ```
|
|
8519
|
+
* @param index - The index to start at
|
|
8520
|
+
* @param deleteCount - The number of answers to remove
|
|
8521
|
+
* @param answers - The replacing answer objects
|
|
8522
|
+
*/
|
|
8523
|
+
spliceAnswers(index: number, deleteCount: number, ...answers: (Omit<APIPollAnswer, 'answer_id'> | PollAnswerBuilder | ((builder: PollAnswerBuilder) => PollAnswerBuilder))[]): this;
|
|
8524
|
+
/**
|
|
8525
|
+
* Sets the answers for this poll.
|
|
8526
|
+
*
|
|
8527
|
+
* @remarks
|
|
8528
|
+
* This method is an alias for {@link PollBuilder.spliceAnswers}. More specifically,
|
|
8529
|
+
* it splices the entire array of answers, replacing them with the provided answers.
|
|
8530
|
+
*
|
|
8531
|
+
* You can set a maximum of 10 answers.
|
|
8532
|
+
* @param answers - The answers to set
|
|
8533
|
+
*/
|
|
8534
|
+
setAnswers(...answers: RestOrArray<Omit<APIPollAnswer, 'answer_id'> | PollAnswerBuilder | ((builder: PollAnswerBuilder) => PollAnswerBuilder)>): this;
|
|
8535
|
+
/**
|
|
8536
|
+
* Sets the question for this poll.
|
|
8537
|
+
*
|
|
8538
|
+
* @param options - The data to use for this poll's question
|
|
8539
|
+
*/
|
|
8540
|
+
setQuestion(options: Omit<APIPollMedia, 'emoji'> | PollQuestionBuilder | ((builder: PollQuestionBuilder) => PollQuestionBuilder)): this;
|
|
8541
|
+
/**
|
|
8542
|
+
* Updates the question of this poll.
|
|
8543
|
+
*
|
|
8544
|
+
* @param updater - The function to update the question with
|
|
8545
|
+
*/
|
|
8546
|
+
updateQuestion(updater: (builder: PollQuestionBuilder) => void): this;
|
|
8547
|
+
/**
|
|
8548
|
+
* Sets the layout type for this poll.
|
|
8549
|
+
*
|
|
8550
|
+
* @remarks
|
|
8551
|
+
* This method is redundant while only one type of poll layout exists (`PollLayoutType.Default`)
|
|
8552
|
+
* with Discord using that as the layout type if none is specified.
|
|
8553
|
+
* @param type - The type of poll layout to use
|
|
8554
|
+
*/
|
|
8555
|
+
setLayoutType(type: PollLayoutType): this;
|
|
8556
|
+
/**
|
|
8557
|
+
* Clears the layout type for this poll.
|
|
8558
|
+
*/
|
|
8559
|
+
clearLayoutType(): this;
|
|
8560
|
+
/**
|
|
8561
|
+
* Sets whether multi-select is enabled for this poll.
|
|
8562
|
+
*
|
|
8563
|
+
* @param multiSelect - Whether to allow multi-select
|
|
8564
|
+
*/
|
|
8565
|
+
setMultiSelect(multiSelect?: boolean): this;
|
|
8566
|
+
/**
|
|
8567
|
+
* Sets how long this poll will be open for in hours.
|
|
8568
|
+
*
|
|
8569
|
+
* @remarks
|
|
8570
|
+
* Minimum duration is `1`, with maximum duration being `768` (32 days).
|
|
8571
|
+
* Default if none specified is `24` (one day).
|
|
8572
|
+
* @param duration - The amount of hours this poll will be open for
|
|
8573
|
+
*/
|
|
8574
|
+
setDuration(duration: number): this;
|
|
8575
|
+
/**
|
|
8576
|
+
* Clears the duration for this poll.
|
|
8577
|
+
*/
|
|
8578
|
+
clearDuration(): this;
|
|
8579
|
+
/**
|
|
8580
|
+
* Serializes this builder to API-compatible JSON data.
|
|
8581
|
+
*
|
|
8582
|
+
* Note that by disabling validation, there is no guarantee that the resulting object will be valid.
|
|
8583
|
+
*
|
|
8584
|
+
* @param validationOverride - Force validation to run/not run regardless of your global preference
|
|
8585
|
+
*/
|
|
8586
|
+
toJSON(validationOverride?: boolean): RESTAPIPoll;
|
|
8587
|
+
}
|
|
8588
|
+
|
|
8163
8589
|
/**
|
|
8164
8590
|
* Calculates the length of the embed.
|
|
8165
8591
|
*
|
|
@@ -8167,6 +8593,19 @@ declare class EmbedBuilder implements JSONEncodable<APIEmbed> {
|
|
|
8167
8593
|
*/
|
|
8168
8594
|
declare function embedLength(data: APIEmbed): number;
|
|
8169
8595
|
|
|
8596
|
+
/**
|
|
8597
|
+
* "Resolves" a builder from the 3 ways it can be input:
|
|
8598
|
+
* 1. A clean instance
|
|
8599
|
+
* 2. A data object that can be used to construct the builder
|
|
8600
|
+
* 3. A function that takes a builder and returns a builder e.g. `builder => builder.setFoo('bar')`
|
|
8601
|
+
*
|
|
8602
|
+
* @typeParam Builder - The builder type
|
|
8603
|
+
* @typeParam BuilderData - The data object that can be used to construct the builder
|
|
8604
|
+
* @param builder - The user input, as described in the function description
|
|
8605
|
+
* @param Constructor - The constructor of the builder
|
|
8606
|
+
*/
|
|
8607
|
+
declare function resolveBuilder<Builder extends JSONEncodable<any>, BuilderData extends Record<PropertyKey, any>>(builder: Builder | BuilderData | ((builder: Builder) => Builder), Constructor: new (data?: BuilderData) => Builder): Builder;
|
|
8608
|
+
|
|
8170
8609
|
/**
|
|
8171
8610
|
* Enables validators.
|
|
8172
8611
|
*
|
|
@@ -8273,4 +8712,4 @@ declare const refineURLPredicate: (allowedProtocols: string[]) => (value: string
|
|
|
8273
8712
|
*/
|
|
8274
8713
|
declare const version: string;
|
|
8275
8714
|
|
|
8276
|
-
export { ActionRowBuilder, type ActionRowBuilderData, type AnyAPIActionRowComponent, type AnyActionRowComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, 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, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, LinkButtonBuilder, type MappedComponentTypes, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, MessageContextCommandBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextInputBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, actionRowPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, integerOptionPredicate, isValidationEnabled, localeMapPredicate, memberPermissionsPredicate, messageCommandPredicate, modalPredicate, normalizeArray, numberOptionPredicate, refineURLPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, stringOptionPredicate, textInputPredicate, userCommandPredicate, validate, version };
|
|
8715
|
+
export { ActionRowBuilder, type ActionRowBuilderData, type AnyAPIActionRowComponent, type AnyActionRowComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, 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, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, LinkButtonBuilder, type MappedComponentTypes, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, MessageContextCommandBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextInputBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, actionRowPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, integerOptionPredicate, isValidationEnabled, localeMapPredicate, memberPermissionsPredicate, messageCommandPredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, refineURLPredicate, resolveBuilder, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, stringOptionPredicate, textInputPredicate, userCommandPredicate, validate, version };
|