@discordjs/builders 2.0.0-dev.1740746538-46be1567a → 2.0.0-dev.1740874411-d1f56ffb2
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 +42 -22
- package/dist/index.d.ts +42 -22
- package/dist/index.js +28 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -8169,7 +8169,7 @@ declare const pollQuestionPredicate: z.ZodObject<{
|
|
|
8169
8169
|
}>;
|
|
8170
8170
|
declare const pollAnswerMediaPredicate: z.ZodObject<{
|
|
8171
8171
|
text: z.ZodString;
|
|
8172
|
-
emoji: z.ZodOptional<z.
|
|
8172
|
+
emoji: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
8173
8173
|
id: z.ZodOptional<z.ZodString>;
|
|
8174
8174
|
name: z.ZodOptional<z.ZodString>;
|
|
8175
8175
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8189,26 +8189,26 @@ declare const pollAnswerMediaPredicate: z.ZodObject<{
|
|
|
8189
8189
|
id?: string | undefined;
|
|
8190
8190
|
name?: string | undefined;
|
|
8191
8191
|
animated?: boolean | undefined;
|
|
8192
|
-
}
|
|
8192
|
+
}>>;
|
|
8193
8193
|
}, "strip", z.ZodTypeAny, {
|
|
8194
8194
|
text: string;
|
|
8195
8195
|
emoji?: {
|
|
8196
8196
|
id?: string | undefined;
|
|
8197
8197
|
name?: string | undefined;
|
|
8198
8198
|
animated?: boolean | undefined;
|
|
8199
|
-
} |
|
|
8199
|
+
} | undefined;
|
|
8200
8200
|
}, {
|
|
8201
8201
|
text: string;
|
|
8202
8202
|
emoji?: {
|
|
8203
8203
|
id?: string | undefined;
|
|
8204
8204
|
name?: string | undefined;
|
|
8205
8205
|
animated?: boolean | undefined;
|
|
8206
|
-
} |
|
|
8206
|
+
} | undefined;
|
|
8207
8207
|
}>;
|
|
8208
8208
|
declare const pollAnswerPredicate: z.ZodObject<{
|
|
8209
8209
|
poll_media: z.ZodObject<{
|
|
8210
8210
|
text: z.ZodString;
|
|
8211
|
-
emoji: z.ZodOptional<z.
|
|
8211
|
+
emoji: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
8212
8212
|
id: z.ZodOptional<z.ZodString>;
|
|
8213
8213
|
name: z.ZodOptional<z.ZodString>;
|
|
8214
8214
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8228,21 +8228,21 @@ declare const pollAnswerPredicate: z.ZodObject<{
|
|
|
8228
8228
|
id?: string | undefined;
|
|
8229
8229
|
name?: string | undefined;
|
|
8230
8230
|
animated?: boolean | undefined;
|
|
8231
|
-
}
|
|
8231
|
+
}>>;
|
|
8232
8232
|
}, "strip", z.ZodTypeAny, {
|
|
8233
8233
|
text: string;
|
|
8234
8234
|
emoji?: {
|
|
8235
8235
|
id?: string | undefined;
|
|
8236
8236
|
name?: string | undefined;
|
|
8237
8237
|
animated?: boolean | undefined;
|
|
8238
|
-
} |
|
|
8238
|
+
} | undefined;
|
|
8239
8239
|
}, {
|
|
8240
8240
|
text: string;
|
|
8241
8241
|
emoji?: {
|
|
8242
8242
|
id?: string | undefined;
|
|
8243
8243
|
name?: string | undefined;
|
|
8244
8244
|
animated?: boolean | undefined;
|
|
8245
|
-
} |
|
|
8245
|
+
} | undefined;
|
|
8246
8246
|
}>;
|
|
8247
8247
|
}, "strip", z.ZodTypeAny, {
|
|
8248
8248
|
poll_media: {
|
|
@@ -8251,7 +8251,7 @@ declare const pollAnswerPredicate: z.ZodObject<{
|
|
|
8251
8251
|
id?: string | undefined;
|
|
8252
8252
|
name?: string | undefined;
|
|
8253
8253
|
animated?: boolean | undefined;
|
|
8254
|
-
} |
|
|
8254
|
+
} | undefined;
|
|
8255
8255
|
};
|
|
8256
8256
|
}, {
|
|
8257
8257
|
poll_media: {
|
|
@@ -8260,7 +8260,7 @@ declare const pollAnswerPredicate: z.ZodObject<{
|
|
|
8260
8260
|
id?: string | undefined;
|
|
8261
8261
|
name?: string | undefined;
|
|
8262
8262
|
animated?: boolean | undefined;
|
|
8263
|
-
} |
|
|
8263
|
+
} | undefined;
|
|
8264
8264
|
};
|
|
8265
8265
|
}>;
|
|
8266
8266
|
declare const pollPredicate: z.ZodObject<{
|
|
@@ -8274,7 +8274,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8274
8274
|
answers: z.ZodArray<z.ZodObject<{
|
|
8275
8275
|
poll_media: z.ZodObject<{
|
|
8276
8276
|
text: z.ZodString;
|
|
8277
|
-
emoji: z.ZodOptional<z.
|
|
8277
|
+
emoji: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
8278
8278
|
id: z.ZodOptional<z.ZodString>;
|
|
8279
8279
|
name: z.ZodOptional<z.ZodString>;
|
|
8280
8280
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8294,21 +8294,21 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8294
8294
|
id?: string | undefined;
|
|
8295
8295
|
name?: string | undefined;
|
|
8296
8296
|
animated?: boolean | undefined;
|
|
8297
|
-
}
|
|
8297
|
+
}>>;
|
|
8298
8298
|
}, "strip", z.ZodTypeAny, {
|
|
8299
8299
|
text: string;
|
|
8300
8300
|
emoji?: {
|
|
8301
8301
|
id?: string | undefined;
|
|
8302
8302
|
name?: string | undefined;
|
|
8303
8303
|
animated?: boolean | undefined;
|
|
8304
|
-
} |
|
|
8304
|
+
} | undefined;
|
|
8305
8305
|
}, {
|
|
8306
8306
|
text: string;
|
|
8307
8307
|
emoji?: {
|
|
8308
8308
|
id?: string | undefined;
|
|
8309
8309
|
name?: string | undefined;
|
|
8310
8310
|
animated?: boolean | undefined;
|
|
8311
|
-
} |
|
|
8311
|
+
} | undefined;
|
|
8312
8312
|
}>;
|
|
8313
8313
|
}, "strip", z.ZodTypeAny, {
|
|
8314
8314
|
poll_media: {
|
|
@@ -8317,7 +8317,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8317
8317
|
id?: string | undefined;
|
|
8318
8318
|
name?: string | undefined;
|
|
8319
8319
|
animated?: boolean | undefined;
|
|
8320
|
-
} |
|
|
8320
|
+
} | undefined;
|
|
8321
8321
|
};
|
|
8322
8322
|
}, {
|
|
8323
8323
|
poll_media: {
|
|
@@ -8326,7 +8326,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8326
8326
|
id?: string | undefined;
|
|
8327
8327
|
name?: string | undefined;
|
|
8328
8328
|
animated?: boolean | undefined;
|
|
8329
|
-
} |
|
|
8329
|
+
} | undefined;
|
|
8330
8330
|
};
|
|
8331
8331
|
}>, "many">;
|
|
8332
8332
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
@@ -8343,7 +8343,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8343
8343
|
id?: string | undefined;
|
|
8344
8344
|
name?: string | undefined;
|
|
8345
8345
|
animated?: boolean | undefined;
|
|
8346
|
-
} |
|
|
8346
|
+
} | undefined;
|
|
8347
8347
|
};
|
|
8348
8348
|
}[];
|
|
8349
8349
|
duration?: number | undefined;
|
|
@@ -8360,7 +8360,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8360
8360
|
id?: string | undefined;
|
|
8361
8361
|
name?: string | undefined;
|
|
8362
8362
|
animated?: boolean | undefined;
|
|
8363
|
-
} |
|
|
8363
|
+
} | undefined;
|
|
8364
8364
|
};
|
|
8365
8365
|
}[];
|
|
8366
8366
|
duration?: number | undefined;
|
|
@@ -8368,7 +8368,13 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8368
8368
|
layout_type?: PollLayoutType | undefined;
|
|
8369
8369
|
}>;
|
|
8370
8370
|
|
|
8371
|
+
/**
|
|
8372
|
+
* The base poll media builder that contains common symbols for poll media builders.
|
|
8373
|
+
*/
|
|
8371
8374
|
declare abstract class PollMediaBuilder {
|
|
8375
|
+
/**
|
|
8376
|
+
* The API data associated with this poll media.
|
|
8377
|
+
*/
|
|
8372
8378
|
protected readonly data: Partial<APIPollMedia>;
|
|
8373
8379
|
/**
|
|
8374
8380
|
* Creates new poll media from API data.
|
|
@@ -8393,19 +8399,22 @@ declare abstract class PollMediaBuilder {
|
|
|
8393
8399
|
}
|
|
8394
8400
|
|
|
8395
8401
|
/**
|
|
8396
|
-
* A builder that creates API-compatible JSON data for poll
|
|
8402
|
+
* A builder that creates API-compatible JSON data for the media of a poll answer.
|
|
8397
8403
|
*/
|
|
8398
8404
|
declare class PollAnswerMediaBuilder extends PollMediaBuilder {
|
|
8399
8405
|
/**
|
|
8400
|
-
* Sets the emoji for this poll answer.
|
|
8406
|
+
* Sets the emoji for this poll answer media.
|
|
8401
8407
|
*
|
|
8402
8408
|
* @param emoji - The emoji to use
|
|
8403
8409
|
*/
|
|
8404
8410
|
setEmoji(emoji: APIPartialEmoji): this;
|
|
8405
8411
|
/**
|
|
8406
|
-
* Clears the emoji for this poll answer.
|
|
8412
|
+
* Clears the emoji for this poll answer media.
|
|
8407
8413
|
*/
|
|
8408
8414
|
clearEmoji(): this;
|
|
8415
|
+
/**
|
|
8416
|
+
* {@inheritDoc PollMediaBuilder.toJSON}
|
|
8417
|
+
*/
|
|
8409
8418
|
toJSON(validationOverride?: boolean): APIPollMedia;
|
|
8410
8419
|
}
|
|
8411
8420
|
|
|
@@ -8413,7 +8422,15 @@ interface PollAnswerData extends Omit<APIPollAnswer, 'answer_id' | 'poll_media'>
|
|
|
8413
8422
|
poll_media: PollAnswerMediaBuilder;
|
|
8414
8423
|
}
|
|
8415
8424
|
declare class PollAnswerBuilder {
|
|
8425
|
+
/**
|
|
8426
|
+
* The API data associated with this poll answer.
|
|
8427
|
+
*/
|
|
8416
8428
|
protected readonly data: PollAnswerData;
|
|
8429
|
+
/**
|
|
8430
|
+
* Creates a new poll answer from API data.
|
|
8431
|
+
*
|
|
8432
|
+
* @param data - The API data to create this poll answer with
|
|
8433
|
+
*/
|
|
8417
8434
|
constructor(data?: Partial<Omit<APIPollAnswer, 'answer_id'>>);
|
|
8418
8435
|
/**
|
|
8419
8436
|
* Sets the media for this poll answer.
|
|
@@ -8426,7 +8443,7 @@ declare class PollAnswerBuilder {
|
|
|
8426
8443
|
*
|
|
8427
8444
|
* @param updater - The function to update the media with
|
|
8428
8445
|
*/
|
|
8429
|
-
updateMedia(updater: (builder: PollAnswerMediaBuilder) => void):
|
|
8446
|
+
updateMedia(updater: (builder: PollAnswerMediaBuilder) => void): this;
|
|
8430
8447
|
/**
|
|
8431
8448
|
* Serializes this builder to API-compatible JSON data.
|
|
8432
8449
|
*
|
|
@@ -8441,6 +8458,9 @@ declare class PollAnswerBuilder {
|
|
|
8441
8458
|
* A builder that creates API-compatible JSON data for a poll question.
|
|
8442
8459
|
*/
|
|
8443
8460
|
declare class PollQuestionBuilder extends PollMediaBuilder {
|
|
8461
|
+
/**
|
|
8462
|
+
* {@inheritDoc PollMediaBuilder.toJSON}
|
|
8463
|
+
*/
|
|
8444
8464
|
toJSON(validationOverride?: boolean): Omit<APIPollMedia, 'emoji'>;
|
|
8445
8465
|
}
|
|
8446
8466
|
|
package/dist/index.d.ts
CHANGED
|
@@ -8169,7 +8169,7 @@ declare const pollQuestionPredicate: z.ZodObject<{
|
|
|
8169
8169
|
}>;
|
|
8170
8170
|
declare const pollAnswerMediaPredicate: z.ZodObject<{
|
|
8171
8171
|
text: z.ZodString;
|
|
8172
|
-
emoji: z.ZodOptional<z.
|
|
8172
|
+
emoji: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
8173
8173
|
id: z.ZodOptional<z.ZodString>;
|
|
8174
8174
|
name: z.ZodOptional<z.ZodString>;
|
|
8175
8175
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8189,26 +8189,26 @@ declare const pollAnswerMediaPredicate: z.ZodObject<{
|
|
|
8189
8189
|
id?: string | undefined;
|
|
8190
8190
|
name?: string | undefined;
|
|
8191
8191
|
animated?: boolean | undefined;
|
|
8192
|
-
}
|
|
8192
|
+
}>>;
|
|
8193
8193
|
}, "strip", z.ZodTypeAny, {
|
|
8194
8194
|
text: string;
|
|
8195
8195
|
emoji?: {
|
|
8196
8196
|
id?: string | undefined;
|
|
8197
8197
|
name?: string | undefined;
|
|
8198
8198
|
animated?: boolean | undefined;
|
|
8199
|
-
} |
|
|
8199
|
+
} | undefined;
|
|
8200
8200
|
}, {
|
|
8201
8201
|
text: string;
|
|
8202
8202
|
emoji?: {
|
|
8203
8203
|
id?: string | undefined;
|
|
8204
8204
|
name?: string | undefined;
|
|
8205
8205
|
animated?: boolean | undefined;
|
|
8206
|
-
} |
|
|
8206
|
+
} | undefined;
|
|
8207
8207
|
}>;
|
|
8208
8208
|
declare const pollAnswerPredicate: z.ZodObject<{
|
|
8209
8209
|
poll_media: z.ZodObject<{
|
|
8210
8210
|
text: z.ZodString;
|
|
8211
|
-
emoji: z.ZodOptional<z.
|
|
8211
|
+
emoji: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
8212
8212
|
id: z.ZodOptional<z.ZodString>;
|
|
8213
8213
|
name: z.ZodOptional<z.ZodString>;
|
|
8214
8214
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8228,21 +8228,21 @@ declare const pollAnswerPredicate: z.ZodObject<{
|
|
|
8228
8228
|
id?: string | undefined;
|
|
8229
8229
|
name?: string | undefined;
|
|
8230
8230
|
animated?: boolean | undefined;
|
|
8231
|
-
}
|
|
8231
|
+
}>>;
|
|
8232
8232
|
}, "strip", z.ZodTypeAny, {
|
|
8233
8233
|
text: string;
|
|
8234
8234
|
emoji?: {
|
|
8235
8235
|
id?: string | undefined;
|
|
8236
8236
|
name?: string | undefined;
|
|
8237
8237
|
animated?: boolean | undefined;
|
|
8238
|
-
} |
|
|
8238
|
+
} | undefined;
|
|
8239
8239
|
}, {
|
|
8240
8240
|
text: string;
|
|
8241
8241
|
emoji?: {
|
|
8242
8242
|
id?: string | undefined;
|
|
8243
8243
|
name?: string | undefined;
|
|
8244
8244
|
animated?: boolean | undefined;
|
|
8245
|
-
} |
|
|
8245
|
+
} | undefined;
|
|
8246
8246
|
}>;
|
|
8247
8247
|
}, "strip", z.ZodTypeAny, {
|
|
8248
8248
|
poll_media: {
|
|
@@ -8251,7 +8251,7 @@ declare const pollAnswerPredicate: z.ZodObject<{
|
|
|
8251
8251
|
id?: string | undefined;
|
|
8252
8252
|
name?: string | undefined;
|
|
8253
8253
|
animated?: boolean | undefined;
|
|
8254
|
-
} |
|
|
8254
|
+
} | undefined;
|
|
8255
8255
|
};
|
|
8256
8256
|
}, {
|
|
8257
8257
|
poll_media: {
|
|
@@ -8260,7 +8260,7 @@ declare const pollAnswerPredicate: z.ZodObject<{
|
|
|
8260
8260
|
id?: string | undefined;
|
|
8261
8261
|
name?: string | undefined;
|
|
8262
8262
|
animated?: boolean | undefined;
|
|
8263
|
-
} |
|
|
8263
|
+
} | undefined;
|
|
8264
8264
|
};
|
|
8265
8265
|
}>;
|
|
8266
8266
|
declare const pollPredicate: z.ZodObject<{
|
|
@@ -8274,7 +8274,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8274
8274
|
answers: z.ZodArray<z.ZodObject<{
|
|
8275
8275
|
poll_media: z.ZodObject<{
|
|
8276
8276
|
text: z.ZodString;
|
|
8277
|
-
emoji: z.ZodOptional<z.
|
|
8277
|
+
emoji: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
8278
8278
|
id: z.ZodOptional<z.ZodString>;
|
|
8279
8279
|
name: z.ZodOptional<z.ZodString>;
|
|
8280
8280
|
animated: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -8294,21 +8294,21 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8294
8294
|
id?: string | undefined;
|
|
8295
8295
|
name?: string | undefined;
|
|
8296
8296
|
animated?: boolean | undefined;
|
|
8297
|
-
}
|
|
8297
|
+
}>>;
|
|
8298
8298
|
}, "strip", z.ZodTypeAny, {
|
|
8299
8299
|
text: string;
|
|
8300
8300
|
emoji?: {
|
|
8301
8301
|
id?: string | undefined;
|
|
8302
8302
|
name?: string | undefined;
|
|
8303
8303
|
animated?: boolean | undefined;
|
|
8304
|
-
} |
|
|
8304
|
+
} | undefined;
|
|
8305
8305
|
}, {
|
|
8306
8306
|
text: string;
|
|
8307
8307
|
emoji?: {
|
|
8308
8308
|
id?: string | undefined;
|
|
8309
8309
|
name?: string | undefined;
|
|
8310
8310
|
animated?: boolean | undefined;
|
|
8311
|
-
} |
|
|
8311
|
+
} | undefined;
|
|
8312
8312
|
}>;
|
|
8313
8313
|
}, "strip", z.ZodTypeAny, {
|
|
8314
8314
|
poll_media: {
|
|
@@ -8317,7 +8317,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8317
8317
|
id?: string | undefined;
|
|
8318
8318
|
name?: string | undefined;
|
|
8319
8319
|
animated?: boolean | undefined;
|
|
8320
|
-
} |
|
|
8320
|
+
} | undefined;
|
|
8321
8321
|
};
|
|
8322
8322
|
}, {
|
|
8323
8323
|
poll_media: {
|
|
@@ -8326,7 +8326,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8326
8326
|
id?: string | undefined;
|
|
8327
8327
|
name?: string | undefined;
|
|
8328
8328
|
animated?: boolean | undefined;
|
|
8329
|
-
} |
|
|
8329
|
+
} | undefined;
|
|
8330
8330
|
};
|
|
8331
8331
|
}>, "many">;
|
|
8332
8332
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
@@ -8343,7 +8343,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8343
8343
|
id?: string | undefined;
|
|
8344
8344
|
name?: string | undefined;
|
|
8345
8345
|
animated?: boolean | undefined;
|
|
8346
|
-
} |
|
|
8346
|
+
} | undefined;
|
|
8347
8347
|
};
|
|
8348
8348
|
}[];
|
|
8349
8349
|
duration?: number | undefined;
|
|
@@ -8360,7 +8360,7 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8360
8360
|
id?: string | undefined;
|
|
8361
8361
|
name?: string | undefined;
|
|
8362
8362
|
animated?: boolean | undefined;
|
|
8363
|
-
} |
|
|
8363
|
+
} | undefined;
|
|
8364
8364
|
};
|
|
8365
8365
|
}[];
|
|
8366
8366
|
duration?: number | undefined;
|
|
@@ -8368,7 +8368,13 @@ declare const pollPredicate: z.ZodObject<{
|
|
|
8368
8368
|
layout_type?: PollLayoutType | undefined;
|
|
8369
8369
|
}>;
|
|
8370
8370
|
|
|
8371
|
+
/**
|
|
8372
|
+
* The base poll media builder that contains common symbols for poll media builders.
|
|
8373
|
+
*/
|
|
8371
8374
|
declare abstract class PollMediaBuilder {
|
|
8375
|
+
/**
|
|
8376
|
+
* The API data associated with this poll media.
|
|
8377
|
+
*/
|
|
8372
8378
|
protected readonly data: Partial<APIPollMedia>;
|
|
8373
8379
|
/**
|
|
8374
8380
|
* Creates new poll media from API data.
|
|
@@ -8393,19 +8399,22 @@ declare abstract class PollMediaBuilder {
|
|
|
8393
8399
|
}
|
|
8394
8400
|
|
|
8395
8401
|
/**
|
|
8396
|
-
* A builder that creates API-compatible JSON data for poll
|
|
8402
|
+
* A builder that creates API-compatible JSON data for the media of a poll answer.
|
|
8397
8403
|
*/
|
|
8398
8404
|
declare class PollAnswerMediaBuilder extends PollMediaBuilder {
|
|
8399
8405
|
/**
|
|
8400
|
-
* Sets the emoji for this poll answer.
|
|
8406
|
+
* Sets the emoji for this poll answer media.
|
|
8401
8407
|
*
|
|
8402
8408
|
* @param emoji - The emoji to use
|
|
8403
8409
|
*/
|
|
8404
8410
|
setEmoji(emoji: APIPartialEmoji): this;
|
|
8405
8411
|
/**
|
|
8406
|
-
* Clears the emoji for this poll answer.
|
|
8412
|
+
* Clears the emoji for this poll answer media.
|
|
8407
8413
|
*/
|
|
8408
8414
|
clearEmoji(): this;
|
|
8415
|
+
/**
|
|
8416
|
+
* {@inheritDoc PollMediaBuilder.toJSON}
|
|
8417
|
+
*/
|
|
8409
8418
|
toJSON(validationOverride?: boolean): APIPollMedia;
|
|
8410
8419
|
}
|
|
8411
8420
|
|
|
@@ -8413,7 +8422,15 @@ interface PollAnswerData extends Omit<APIPollAnswer, 'answer_id' | 'poll_media'>
|
|
|
8413
8422
|
poll_media: PollAnswerMediaBuilder;
|
|
8414
8423
|
}
|
|
8415
8424
|
declare class PollAnswerBuilder {
|
|
8425
|
+
/**
|
|
8426
|
+
* The API data associated with this poll answer.
|
|
8427
|
+
*/
|
|
8416
8428
|
protected readonly data: PollAnswerData;
|
|
8429
|
+
/**
|
|
8430
|
+
* Creates a new poll answer from API data.
|
|
8431
|
+
*
|
|
8432
|
+
* @param data - The API data to create this poll answer with
|
|
8433
|
+
*/
|
|
8417
8434
|
constructor(data?: Partial<Omit<APIPollAnswer, 'answer_id'>>);
|
|
8418
8435
|
/**
|
|
8419
8436
|
* Sets the media for this poll answer.
|
|
@@ -8426,7 +8443,7 @@ declare class PollAnswerBuilder {
|
|
|
8426
8443
|
*
|
|
8427
8444
|
* @param updater - The function to update the media with
|
|
8428
8445
|
*/
|
|
8429
|
-
updateMedia(updater: (builder: PollAnswerMediaBuilder) => void):
|
|
8446
|
+
updateMedia(updater: (builder: PollAnswerMediaBuilder) => void): this;
|
|
8430
8447
|
/**
|
|
8431
8448
|
* Serializes this builder to API-compatible JSON data.
|
|
8432
8449
|
*
|
|
@@ -8441,6 +8458,9 @@ declare class PollAnswerBuilder {
|
|
|
8441
8458
|
* A builder that creates API-compatible JSON data for a poll question.
|
|
8442
8459
|
*/
|
|
8443
8460
|
declare class PollQuestionBuilder extends PollMediaBuilder {
|
|
8461
|
+
/**
|
|
8462
|
+
* {@inheritDoc PollMediaBuilder.toJSON}
|
|
8463
|
+
*/
|
|
8444
8464
|
toJSON(validationOverride?: boolean): Omit<APIPollMedia, 'emoji'>;
|
|
8445
8465
|
}
|
|
8446
8466
|
|
package/dist/index.js
CHANGED
|
@@ -3086,12 +3086,12 @@ var import_zod8 = require("zod");
|
|
|
3086
3086
|
var pollQuestionPredicate = import_zod8.z.object({ text: import_zod8.z.string().min(1).max(300) });
|
|
3087
3087
|
var pollAnswerMediaPredicate = import_zod8.z.object({
|
|
3088
3088
|
text: import_zod8.z.string().min(1).max(55),
|
|
3089
|
-
emoji: emojiPredicate.
|
|
3089
|
+
emoji: emojiPredicate.optional()
|
|
3090
3090
|
});
|
|
3091
3091
|
var pollAnswerPredicate = import_zod8.z.object({ poll_media: pollAnswerMediaPredicate });
|
|
3092
3092
|
var pollPredicate = import_zod8.z.object({
|
|
3093
3093
|
question: pollQuestionPredicate,
|
|
3094
|
-
answers: import_zod8.z.array(pollAnswerPredicate).max(10),
|
|
3094
|
+
answers: import_zod8.z.array(pollAnswerPredicate).min(1).max(10),
|
|
3095
3095
|
duration: import_zod8.z.number().min(1).max(768).optional(),
|
|
3096
3096
|
allow_multiselect: import_zod8.z.boolean().optional(),
|
|
3097
3097
|
layout_type: import_zod8.z.nativeEnum(import_v1032.PollLayoutType).optional()
|
|
@@ -3102,6 +3102,9 @@ var PollMediaBuilder = class {
|
|
|
3102
3102
|
static {
|
|
3103
3103
|
__name(this, "PollMediaBuilder");
|
|
3104
3104
|
}
|
|
3105
|
+
/**
|
|
3106
|
+
* The API data associated with this poll media.
|
|
3107
|
+
*/
|
|
3105
3108
|
data;
|
|
3106
3109
|
/**
|
|
3107
3110
|
* Creates new poll media from API data.
|
|
@@ -3128,7 +3131,7 @@ var PollAnswerMediaBuilder = class extends PollMediaBuilder {
|
|
|
3128
3131
|
__name(this, "PollAnswerMediaBuilder");
|
|
3129
3132
|
}
|
|
3130
3133
|
/**
|
|
3131
|
-
* Sets the emoji for this poll answer.
|
|
3134
|
+
* Sets the emoji for this poll answer media.
|
|
3132
3135
|
*
|
|
3133
3136
|
* @param emoji - The emoji to use
|
|
3134
3137
|
*/
|
|
@@ -3137,12 +3140,15 @@ var PollAnswerMediaBuilder = class extends PollMediaBuilder {
|
|
|
3137
3140
|
return this;
|
|
3138
3141
|
}
|
|
3139
3142
|
/**
|
|
3140
|
-
* Clears the emoji for this poll answer.
|
|
3143
|
+
* Clears the emoji for this poll answer media.
|
|
3141
3144
|
*/
|
|
3142
3145
|
clearEmoji() {
|
|
3143
3146
|
this.data.emoji = void 0;
|
|
3144
3147
|
return this;
|
|
3145
3148
|
}
|
|
3149
|
+
/**
|
|
3150
|
+
* {@inheritDoc PollMediaBuilder.toJSON}
|
|
3151
|
+
*/
|
|
3146
3152
|
toJSON(validationOverride) {
|
|
3147
3153
|
const clone = structuredClone(this.data);
|
|
3148
3154
|
validate(pollAnswerMediaPredicate, clone, validationOverride);
|
|
@@ -3155,7 +3161,15 @@ var PollAnswerBuilder = class {
|
|
|
3155
3161
|
static {
|
|
3156
3162
|
__name(this, "PollAnswerBuilder");
|
|
3157
3163
|
}
|
|
3164
|
+
/**
|
|
3165
|
+
* The API data associated with this poll answer.
|
|
3166
|
+
*/
|
|
3158
3167
|
data;
|
|
3168
|
+
/**
|
|
3169
|
+
* Creates a new poll answer from API data.
|
|
3170
|
+
*
|
|
3171
|
+
* @param data - The API data to create this poll answer with
|
|
3172
|
+
*/
|
|
3159
3173
|
constructor(data = {}) {
|
|
3160
3174
|
this.data = {
|
|
3161
3175
|
...structuredClone(data),
|
|
@@ -3177,7 +3191,8 @@ var PollAnswerBuilder = class {
|
|
|
3177
3191
|
* @param updater - The function to update the media with
|
|
3178
3192
|
*/
|
|
3179
3193
|
updateMedia(updater) {
|
|
3180
|
-
updater(this.data.poll_media
|
|
3194
|
+
updater(this.data.poll_media);
|
|
3195
|
+
return this;
|
|
3181
3196
|
}
|
|
3182
3197
|
/**
|
|
3183
3198
|
* Serializes this builder to API-compatible JSON data.
|
|
@@ -3187,10 +3202,11 @@ var PollAnswerBuilder = class {
|
|
|
3187
3202
|
* @param validationOverride - Force validation to run/not run regardless of your global preference
|
|
3188
3203
|
*/
|
|
3189
3204
|
toJSON(validationOverride) {
|
|
3205
|
+
const { poll_media, ...rest } = this.data;
|
|
3190
3206
|
const data = {
|
|
3191
|
-
...structuredClone(
|
|
3207
|
+
...structuredClone(rest),
|
|
3192
3208
|
// Disable validation because the pollAnswerPredicate below will validate this as well
|
|
3193
|
-
poll_media:
|
|
3209
|
+
poll_media: poll_media.toJSON(false)
|
|
3194
3210
|
};
|
|
3195
3211
|
validate(pollAnswerPredicate, data, validationOverride);
|
|
3196
3212
|
return data;
|
|
@@ -3202,6 +3218,9 @@ var PollQuestionBuilder = class extends PollMediaBuilder {
|
|
|
3202
3218
|
static {
|
|
3203
3219
|
__name(this, "PollQuestionBuilder");
|
|
3204
3220
|
}
|
|
3221
|
+
/**
|
|
3222
|
+
* {@inheritDoc PollMediaBuilder.toJSON}
|
|
3223
|
+
*/
|
|
3205
3224
|
toJSON(validationOverride) {
|
|
3206
3225
|
const clone = structuredClone(this.data);
|
|
3207
3226
|
validate(pollQuestionPredicate, clone, validationOverride);
|
|
@@ -3329,7 +3348,7 @@ var PollBuilder = class {
|
|
|
3329
3348
|
* @param updater - The function to update the question with
|
|
3330
3349
|
*/
|
|
3331
3350
|
updateQuestion(updater) {
|
|
3332
|
-
updater(this.data.question
|
|
3351
|
+
updater(this.data.question);
|
|
3333
3352
|
return this;
|
|
3334
3353
|
}
|
|
3335
3354
|
/**
|
|
@@ -3400,7 +3419,7 @@ var PollBuilder = class {
|
|
|
3400
3419
|
};
|
|
3401
3420
|
|
|
3402
3421
|
// src/index.ts
|
|
3403
|
-
var version = "2.0.0-dev.
|
|
3422
|
+
var version = "2.0.0-dev.1740874411-d1f56ffb2";
|
|
3404
3423
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3405
3424
|
0 && (module.exports = {
|
|
3406
3425
|
ActionRowBuilder,
|