@discordjs/builders 0.16.0-dev.1656590636-525bf03 → 0.16.0-dev.1656720685-d95197c
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.ts +157 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -111,74 +111,75 @@ declare class UnsafeEmbedBuilder {
|
|
|
111
111
|
/**
|
|
112
112
|
* Adds fields to the embed (max 25)
|
|
113
113
|
*
|
|
114
|
-
* @param fields The fields to add
|
|
114
|
+
* @param fields - The fields to add
|
|
115
115
|
*/
|
|
116
116
|
addFields(...fields: RestOrArray<APIEmbedField>): this;
|
|
117
117
|
/**
|
|
118
118
|
* Removes, replaces, or inserts fields in the embed (max 25)
|
|
119
119
|
*
|
|
120
|
-
* @param index The index to start at
|
|
121
|
-
* @param deleteCount The number of fields to remove
|
|
122
|
-
* @param fields The replacing field objects
|
|
120
|
+
* @param index - The index to start at
|
|
121
|
+
* @param deleteCount - The number of fields to remove
|
|
122
|
+
* @param fields - The replacing field objects
|
|
123
123
|
*/
|
|
124
124
|
spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
|
|
125
125
|
/**
|
|
126
126
|
* Sets the embed's fields (max 25).
|
|
127
|
-
*
|
|
127
|
+
*
|
|
128
|
+
* @param fields - The fields to set
|
|
128
129
|
*/
|
|
129
130
|
setFields(...fields: RestOrArray<APIEmbedField>): this;
|
|
130
131
|
/**
|
|
131
132
|
* Sets the author of this embed
|
|
132
133
|
*
|
|
133
|
-
* @param options The options for the author
|
|
134
|
+
* @param options - The options for the author
|
|
134
135
|
*/
|
|
135
136
|
setAuthor(options: EmbedAuthorOptions | null): this;
|
|
136
137
|
/**
|
|
137
138
|
* Sets the color of this embed
|
|
138
139
|
*
|
|
139
|
-
* @param color The color of the embed
|
|
140
|
+
* @param color - The color of the embed
|
|
140
141
|
*/
|
|
141
142
|
setColor(color: number | RGBTuple | null): this;
|
|
142
143
|
/**
|
|
143
144
|
* Sets the description of this embed
|
|
144
145
|
*
|
|
145
|
-
* @param description The description
|
|
146
|
+
* @param description - The description
|
|
146
147
|
*/
|
|
147
148
|
setDescription(description: string | null): this;
|
|
148
149
|
/**
|
|
149
150
|
* Sets the footer of this embed
|
|
150
151
|
*
|
|
151
|
-
* @param options The options for the footer
|
|
152
|
+
* @param options - The options for the footer
|
|
152
153
|
*/
|
|
153
154
|
setFooter(options: EmbedFooterOptions | null): this;
|
|
154
155
|
/**
|
|
155
156
|
* Sets the image of this embed
|
|
156
157
|
*
|
|
157
|
-
* @param url The URL of the image
|
|
158
|
+
* @param url - The URL of the image
|
|
158
159
|
*/
|
|
159
160
|
setImage(url: string | null): this;
|
|
160
161
|
/**
|
|
161
162
|
* Sets the thumbnail of this embed
|
|
162
163
|
*
|
|
163
|
-
* @param url The URL of the thumbnail
|
|
164
|
+
* @param url - The URL of the thumbnail
|
|
164
165
|
*/
|
|
165
166
|
setThumbnail(url: string | null): this;
|
|
166
167
|
/**
|
|
167
168
|
* Sets the timestamp of this embed
|
|
168
169
|
*
|
|
169
|
-
* @param timestamp The timestamp or date
|
|
170
|
+
* @param timestamp - The timestamp or date
|
|
170
171
|
*/
|
|
171
172
|
setTimestamp(timestamp?: number | Date | null): this;
|
|
172
173
|
/**
|
|
173
174
|
* Sets the title of this embed
|
|
174
175
|
*
|
|
175
|
-
* @param title The title
|
|
176
|
+
* @param title - The title
|
|
176
177
|
*/
|
|
177
178
|
setTitle(title: string | null): this;
|
|
178
179
|
/**
|
|
179
180
|
* Sets the URL of this embed
|
|
180
181
|
*
|
|
181
|
-
* @param url The URL
|
|
182
|
+
* @param url - The URL
|
|
182
183
|
*/
|
|
183
184
|
setURL(url: string | null): this;
|
|
184
185
|
/**
|
|
@@ -207,161 +208,161 @@ declare class EmbedBuilder extends UnsafeEmbedBuilder {
|
|
|
207
208
|
/**
|
|
208
209
|
* Wraps the content inside a codeblock with no language
|
|
209
210
|
*
|
|
210
|
-
* @param content The content to wrap
|
|
211
|
+
* @param content - The content to wrap
|
|
211
212
|
*/
|
|
212
213
|
declare function codeBlock<C extends string>(content: C): `\`\`\`\n${C}\`\`\``;
|
|
213
214
|
/**
|
|
214
215
|
* Wraps the content inside a codeblock with the specified language
|
|
215
216
|
*
|
|
216
|
-
* @param language The language for the codeblock
|
|
217
|
-
* @param content The content to wrap
|
|
217
|
+
* @param language - The language for the codeblock
|
|
218
|
+
* @param content - The content to wrap
|
|
218
219
|
*/
|
|
219
220
|
declare function codeBlock<L extends string, C extends string>(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``;
|
|
220
221
|
/**
|
|
221
222
|
* Wraps the content inside \`backticks\`, which formats it as inline code
|
|
222
223
|
*
|
|
223
|
-
* @param content The content to wrap
|
|
224
|
+
* @param content - The content to wrap
|
|
224
225
|
*/
|
|
225
226
|
declare function inlineCode<C extends string>(content: C): `\`${C}\``;
|
|
226
227
|
/**
|
|
227
228
|
* Formats the content into italic text
|
|
228
229
|
*
|
|
229
|
-
* @param content The content to wrap
|
|
230
|
+
* @param content - The content to wrap
|
|
230
231
|
*/
|
|
231
232
|
declare function italic<C extends string>(content: C): `_${C}_`;
|
|
232
233
|
/**
|
|
233
234
|
* Formats the content into bold text
|
|
234
235
|
*
|
|
235
|
-
* @param content The content to wrap
|
|
236
|
+
* @param content - The content to wrap
|
|
236
237
|
*/
|
|
237
238
|
declare function bold<C extends string>(content: C): `**${C}**`;
|
|
238
239
|
/**
|
|
239
240
|
* Formats the content into underscored text
|
|
240
241
|
*
|
|
241
|
-
* @param content The content to wrap
|
|
242
|
+
* @param content - The content to wrap
|
|
242
243
|
*/
|
|
243
244
|
declare function underscore<C extends string>(content: C): `__${C}__`;
|
|
244
245
|
/**
|
|
245
246
|
* Formats the content into strike-through text
|
|
246
247
|
*
|
|
247
|
-
* @param content The content to wrap
|
|
248
|
+
* @param content - The content to wrap
|
|
248
249
|
*/
|
|
249
250
|
declare function strikethrough<C extends string>(content: C): `~~${C}~~`;
|
|
250
251
|
/**
|
|
251
252
|
* Formats the content into a quote. This needs to be at the start of the line for Discord to format it
|
|
252
253
|
*
|
|
253
|
-
* @param content The content to wrap
|
|
254
|
+
* @param content - The content to wrap
|
|
254
255
|
*/
|
|
255
256
|
declare function quote<C extends string>(content: C): `> ${C}`;
|
|
256
257
|
/**
|
|
257
258
|
* Formats the content into a block quote. This needs to be at the start of the line for Discord to format it
|
|
258
259
|
*
|
|
259
|
-
* @param content The content to wrap
|
|
260
|
+
* @param content - The content to wrap
|
|
260
261
|
*/
|
|
261
262
|
declare function blockQuote<C extends string>(content: C): `>>> ${C}`;
|
|
262
263
|
/**
|
|
263
264
|
* Wraps the URL into `<>`, which stops it from embedding
|
|
264
265
|
*
|
|
265
|
-
* @param url The URL to wrap
|
|
266
|
+
* @param url - The URL to wrap
|
|
266
267
|
*/
|
|
267
268
|
declare function hideLinkEmbed<C extends string>(url: C): `<${C}>`;
|
|
268
269
|
/**
|
|
269
270
|
* Wraps the URL into `<>`, which stops it from embedding
|
|
270
271
|
*
|
|
271
|
-
* @param url The URL to wrap
|
|
272
|
+
* @param url - The URL to wrap
|
|
272
273
|
*/
|
|
273
274
|
declare function hideLinkEmbed(url: URL): `<${string}>`;
|
|
274
275
|
/**
|
|
275
276
|
* Formats the content and the URL into a masked URL
|
|
276
277
|
*
|
|
277
|
-
* @param content The content to display
|
|
278
|
-
* @param url The URL the content links to
|
|
278
|
+
* @param content - The content to display
|
|
279
|
+
* @param url - The URL the content links to
|
|
279
280
|
*/
|
|
280
281
|
declare function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;
|
|
281
282
|
/**
|
|
282
283
|
* Formats the content and the URL into a masked URL
|
|
283
284
|
*
|
|
284
|
-
* @param content The content to display
|
|
285
|
-
* @param url The URL the content links to
|
|
285
|
+
* @param content - The content to display
|
|
286
|
+
* @param url - The URL the content links to
|
|
286
287
|
*/
|
|
287
288
|
declare function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;
|
|
288
289
|
/**
|
|
289
290
|
* Formats the content and the URL into a masked URL
|
|
290
291
|
*
|
|
291
|
-
* @param content The content to display
|
|
292
|
-
* @param url The URL the content links to
|
|
293
|
-
* @param title The title shown when hovering on the masked link
|
|
292
|
+
* @param content - The content to display
|
|
293
|
+
* @param url - The URL the content links to
|
|
294
|
+
* @param title - The title shown when hovering on the masked link
|
|
294
295
|
*/
|
|
295
296
|
declare function hyperlink<C extends string, T extends string>(content: C, url: URL, title: T): `[${C}](${string} "${T}")`;
|
|
296
297
|
/**
|
|
297
298
|
* Formats the content and the URL into a masked URL
|
|
298
299
|
*
|
|
299
|
-
* @param content The content to display
|
|
300
|
-
* @param url The URL the content links to
|
|
301
|
-
* @param title The title shown when hovering on the masked link
|
|
300
|
+
* @param content - The content to display
|
|
301
|
+
* @param url - The URL the content links to
|
|
302
|
+
* @param title - The title shown when hovering on the masked link
|
|
302
303
|
*/
|
|
303
304
|
declare function hyperlink<C extends string, U extends string, T extends string>(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
|
|
304
305
|
/**
|
|
305
306
|
* Wraps the content inside spoiler (hidden text)
|
|
306
307
|
*
|
|
307
|
-
* @param content The content to wrap
|
|
308
|
+
* @param content - The content to wrap
|
|
308
309
|
*/
|
|
309
310
|
declare function spoiler<C extends string>(content: C): `||${C}||`;
|
|
310
311
|
/**
|
|
311
312
|
* Formats a user ID into a user mention
|
|
312
313
|
*
|
|
313
|
-
* @param userId The user ID to format
|
|
314
|
+
* @param userId - The user ID to format
|
|
314
315
|
*/
|
|
315
316
|
declare function userMention<C extends Snowflake>(userId: C): `<@${C}>`;
|
|
316
317
|
/**
|
|
317
318
|
* Formats a channel ID into a channel mention
|
|
318
319
|
*
|
|
319
|
-
* @param channelId The channel ID to format
|
|
320
|
+
* @param channelId - The channel ID to format
|
|
320
321
|
*/
|
|
321
322
|
declare function channelMention<C extends Snowflake>(channelId: C): `<#${C}>`;
|
|
322
323
|
/**
|
|
323
324
|
* Formats a role ID into a role mention
|
|
324
325
|
*
|
|
325
|
-
* @param roleId The role ID to format
|
|
326
|
+
* @param roleId - The role ID to format
|
|
326
327
|
*/
|
|
327
328
|
declare function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>`;
|
|
328
329
|
/**
|
|
329
330
|
* Formats an emoji ID into a fully qualified emoji identifier
|
|
330
331
|
*
|
|
331
|
-
* @param emojiId The emoji ID to format
|
|
332
|
+
* @param emojiId - The emoji ID to format
|
|
332
333
|
*/
|
|
333
334
|
declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;
|
|
334
335
|
/**
|
|
335
336
|
* Formats an emoji ID into a fully qualified emoji identifier
|
|
336
337
|
*
|
|
337
|
-
* @param emojiId The emoji ID to format
|
|
338
|
-
* @param animated Whether the emoji is animated or not. Defaults to `false`
|
|
338
|
+
* @param emojiId - The emoji ID to format
|
|
339
|
+
* @param animated - Whether the emoji is animated or not. Defaults to `false`
|
|
339
340
|
*/
|
|
340
341
|
declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;
|
|
341
342
|
/**
|
|
342
343
|
* Formats a date into a short date-time string
|
|
343
344
|
*
|
|
344
|
-
* @param date The date to format, defaults to the current time
|
|
345
|
+
* @param date - The date to format, defaults to the current time
|
|
345
346
|
*/
|
|
346
347
|
declare function time(date?: Date): `<t:${bigint}>`;
|
|
347
348
|
/**
|
|
348
349
|
* Formats a date given a format style
|
|
349
350
|
*
|
|
350
|
-
* @param date The date to format
|
|
351
|
-
* @param style The style to use
|
|
351
|
+
* @param date - The date to format
|
|
352
|
+
* @param style - The style to use
|
|
352
353
|
*/
|
|
353
354
|
declare function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;
|
|
354
355
|
/**
|
|
355
356
|
* Formats the given timestamp into a short date-time string
|
|
356
357
|
*
|
|
357
|
-
* @param seconds The time to format, represents an UNIX timestamp in seconds
|
|
358
|
+
* @param seconds - The time to format, represents an UNIX timestamp in seconds
|
|
358
359
|
*/
|
|
359
360
|
declare function time<C extends number>(seconds: C): `<t:${C}>`;
|
|
360
361
|
/**
|
|
361
362
|
* Formats the given timestamp into a short date-time string
|
|
362
363
|
*
|
|
363
|
-
* @param seconds The time to format, represents an UNIX timestamp in seconds
|
|
364
|
-
* @param style The style to use
|
|
364
|
+
* @param seconds - The time to format, represents an UNIX timestamp in seconds
|
|
365
|
+
* @param style - The style to use
|
|
365
366
|
*/
|
|
366
367
|
declare function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;
|
|
367
368
|
/**
|
|
@@ -427,27 +428,32 @@ declare class UnsafeSelectMenuOptionBuilder {
|
|
|
427
428
|
constructor(data?: Partial<APISelectMenuOption>);
|
|
428
429
|
/**
|
|
429
430
|
* Sets the label of this option
|
|
430
|
-
*
|
|
431
|
+
*
|
|
432
|
+
* @param label - The label to show on this option
|
|
431
433
|
*/
|
|
432
434
|
setLabel(label: string): this;
|
|
433
435
|
/**
|
|
434
436
|
* Sets the value of this option
|
|
435
|
-
*
|
|
437
|
+
*
|
|
438
|
+
* @param value - The value of this option
|
|
436
439
|
*/
|
|
437
440
|
setValue(value: string): this;
|
|
438
441
|
/**
|
|
439
442
|
* Sets the description of this option.
|
|
440
|
-
*
|
|
443
|
+
*
|
|
444
|
+
* @param description - The description of this option
|
|
441
445
|
*/
|
|
442
446
|
setDescription(description: string): this;
|
|
443
447
|
/**
|
|
444
448
|
* Sets whether this option is selected by default
|
|
445
|
-
*
|
|
449
|
+
*
|
|
450
|
+
* @param isDefault - Whether this option is selected by default
|
|
446
451
|
*/
|
|
447
452
|
setDefault(isDefault?: boolean): this;
|
|
448
453
|
/**
|
|
449
454
|
* Sets the emoji to display on this option
|
|
450
|
-
*
|
|
455
|
+
*
|
|
456
|
+
* @param emoji - The emoji to display on this option
|
|
451
457
|
*/
|
|
452
458
|
setEmoji(emoji: APIMessageComponentEmoji): this;
|
|
453
459
|
toJSON(): APISelectMenuOption;
|
|
@@ -551,7 +557,7 @@ interface JSONEncodable<T> {
|
|
|
551
557
|
}
|
|
552
558
|
/**
|
|
553
559
|
* Indicates if an object is encodable or not.
|
|
554
|
-
* @param maybeEncodable The object to check against
|
|
560
|
+
* @param maybeEncodable - The object to check against
|
|
555
561
|
*/
|
|
556
562
|
declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown>;
|
|
557
563
|
|
|
@@ -584,13 +590,14 @@ declare class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentB
|
|
|
584
590
|
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIActionRowComponentTypes>>);
|
|
585
591
|
/**
|
|
586
592
|
* Adds components to this action row.
|
|
587
|
-
*
|
|
588
|
-
* @
|
|
593
|
+
*
|
|
594
|
+
* @param components - The components to add to this action row.
|
|
589
595
|
*/
|
|
590
596
|
addComponents(...components: RestOrArray<T>): this;
|
|
591
597
|
/**
|
|
592
598
|
* Sets the components in this action row
|
|
593
|
-
*
|
|
599
|
+
*
|
|
600
|
+
* @param components - The components to set this row to
|
|
594
601
|
*/
|
|
595
602
|
setComponents(...components: RestOrArray<T>): this;
|
|
596
603
|
toJSON(): APIActionRowComponent<ReturnType<T['toJSON']>>;
|
|
@@ -603,32 +610,38 @@ declare class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
|
|
|
603
610
|
constructor(data?: Partial<APIButtonComponent>);
|
|
604
611
|
/**
|
|
605
612
|
* Sets the style of this button
|
|
606
|
-
*
|
|
613
|
+
*
|
|
614
|
+
* @param style - The style of the button
|
|
607
615
|
*/
|
|
608
616
|
setStyle(style: ButtonStyle): this;
|
|
609
617
|
/**
|
|
610
618
|
* Sets the URL for this button
|
|
611
|
-
*
|
|
619
|
+
*
|
|
620
|
+
* @param url - The URL to open when this button is clicked
|
|
612
621
|
*/
|
|
613
622
|
setURL(url: string): this;
|
|
614
623
|
/**
|
|
615
624
|
* Sets the custom Id for this button
|
|
616
|
-
*
|
|
625
|
+
*
|
|
626
|
+
* @param customId - The custom id to use for this button
|
|
617
627
|
*/
|
|
618
628
|
setCustomId(customId: string): this;
|
|
619
629
|
/**
|
|
620
630
|
* Sets the emoji to display on this button
|
|
621
|
-
*
|
|
631
|
+
*
|
|
632
|
+
* @param emoji - The emoji to display on this button
|
|
622
633
|
*/
|
|
623
634
|
setEmoji(emoji: APIMessageComponentEmoji): this;
|
|
624
635
|
/**
|
|
625
636
|
* Sets whether this button is disable or not
|
|
626
|
-
*
|
|
637
|
+
*
|
|
638
|
+
* @param disabled - Whether or not to disable this button or not
|
|
627
639
|
*/
|
|
628
640
|
setDisabled(disabled?: boolean): this;
|
|
629
641
|
/**
|
|
630
642
|
* Sets the label for this button
|
|
631
|
-
*
|
|
643
|
+
*
|
|
644
|
+
* @param label - The label to display on this button
|
|
632
645
|
*/
|
|
633
646
|
setLabel(label: string): this;
|
|
634
647
|
toJSON(): APIButtonComponent;
|
|
@@ -655,7 +668,8 @@ interface MappedComponentTypes {
|
|
|
655
668
|
}
|
|
656
669
|
/**
|
|
657
670
|
* Factory for creating components from API data
|
|
658
|
-
*
|
|
671
|
+
*
|
|
672
|
+
* @param data - The api data to transform to a component class
|
|
659
673
|
*/
|
|
660
674
|
declare function createComponentBuilder<T extends keyof MappedComponentTypes>(data: (APIMessageComponent | APIModalComponent) & {
|
|
661
675
|
type: T;
|
|
@@ -668,42 +682,50 @@ declare class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompon
|
|
|
668
682
|
});
|
|
669
683
|
/**
|
|
670
684
|
* Sets the custom id for this text input
|
|
671
|
-
*
|
|
685
|
+
*
|
|
686
|
+
* @param customId - The custom id of this text input
|
|
672
687
|
*/
|
|
673
688
|
setCustomId(customId: string): this;
|
|
674
689
|
/**
|
|
675
690
|
* Sets the label for this text input
|
|
676
|
-
*
|
|
691
|
+
*
|
|
692
|
+
* @param label - The label for this text input
|
|
677
693
|
*/
|
|
678
694
|
setLabel(label: string): this;
|
|
679
695
|
/**
|
|
680
696
|
* Sets the style for this text input
|
|
681
|
-
*
|
|
697
|
+
*
|
|
698
|
+
* @param style - The style for this text input
|
|
682
699
|
*/
|
|
683
700
|
setStyle(style: TextInputStyle): this;
|
|
684
701
|
/**
|
|
685
702
|
* Sets the minimum length of text for this text input
|
|
686
|
-
*
|
|
703
|
+
*
|
|
704
|
+
* @param minLength - The minimum length of text for this text input
|
|
687
705
|
*/
|
|
688
706
|
setMinLength(minLength: number): this;
|
|
689
707
|
/**
|
|
690
708
|
* Sets the maximum length of text for this text input
|
|
691
|
-
*
|
|
709
|
+
*
|
|
710
|
+
* @param maxLength - The maximum length of text for this text input
|
|
692
711
|
*/
|
|
693
712
|
setMaxLength(maxLength: number): this;
|
|
694
713
|
/**
|
|
695
714
|
* Sets the placeholder of this text input
|
|
696
|
-
*
|
|
715
|
+
*
|
|
716
|
+
* @param placeholder - The placeholder of this text input
|
|
697
717
|
*/
|
|
698
718
|
setPlaceholder(placeholder: string): this;
|
|
699
719
|
/**
|
|
700
720
|
* Sets the value of this text input
|
|
701
|
-
*
|
|
721
|
+
*
|
|
722
|
+
* @param value - The value for this text input
|
|
702
723
|
*/
|
|
703
724
|
setValue(value: string): this;
|
|
704
725
|
/**
|
|
705
726
|
* Sets whether this text input is required or not
|
|
706
|
-
*
|
|
727
|
+
*
|
|
728
|
+
* @param required - Whether this text input is required or not
|
|
707
729
|
*/
|
|
708
730
|
setRequired(required?: boolean): this;
|
|
709
731
|
toJSON(): APITextInputComponent;
|
|
@@ -754,22 +776,26 @@ declare class UnsafeModalBuilder implements JSONEncodable<APIModalInteractionRes
|
|
|
754
776
|
constructor({ components, ...data }?: Partial<APIModalInteractionResponseCallbackData>);
|
|
755
777
|
/**
|
|
756
778
|
* Sets the title of the modal
|
|
757
|
-
*
|
|
779
|
+
*
|
|
780
|
+
* @param title - The title of the modal
|
|
758
781
|
*/
|
|
759
782
|
setTitle(title: string): this;
|
|
760
783
|
/**
|
|
761
784
|
* Sets the custom id of the modal
|
|
762
|
-
*
|
|
785
|
+
*
|
|
786
|
+
* @param customId - The custom id of this modal
|
|
763
787
|
*/
|
|
764
788
|
setCustomId(customId: string): this;
|
|
765
789
|
/**
|
|
766
790
|
* Adds components to this modal
|
|
767
|
-
*
|
|
791
|
+
*
|
|
792
|
+
* @param components - The components to add to this modal
|
|
768
793
|
*/
|
|
769
794
|
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>): this;
|
|
770
795
|
/**
|
|
771
796
|
* Sets the components in this modal
|
|
772
|
-
*
|
|
797
|
+
*
|
|
798
|
+
* @param components - The components to set this modal to
|
|
773
799
|
*/
|
|
774
800
|
setComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder>>): this;
|
|
775
801
|
toJSON(): APIModalInteractionResponseCallbackData;
|
|
@@ -806,38 +832,44 @@ declare class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuComp
|
|
|
806
832
|
constructor(data?: Partial<APISelectMenuComponent>);
|
|
807
833
|
/**
|
|
808
834
|
* Sets the placeholder for this select menu
|
|
809
|
-
*
|
|
835
|
+
*
|
|
836
|
+
* @param placeholder - The placeholder to use for this select menu
|
|
810
837
|
*/
|
|
811
838
|
setPlaceholder(placeholder: string): this;
|
|
812
839
|
/**
|
|
813
840
|
* Sets the minimum values that must be selected in the select menu
|
|
814
|
-
*
|
|
841
|
+
*
|
|
842
|
+
* @param minValues - The minimum values that must be selected
|
|
815
843
|
*/
|
|
816
844
|
setMinValues(minValues: number): this;
|
|
817
845
|
/**
|
|
818
846
|
* Sets the maximum values that must be selected in the select menu
|
|
819
|
-
*
|
|
847
|
+
*
|
|
848
|
+
* @param minValues - The maximum values that must be selected
|
|
820
849
|
*/
|
|
821
850
|
setMaxValues(maxValues: number): this;
|
|
822
851
|
/**
|
|
823
852
|
* Sets the custom Id for this select menu
|
|
824
|
-
*
|
|
853
|
+
*
|
|
854
|
+
* @param customId - The custom id to use for this select menu
|
|
825
855
|
*/
|
|
826
856
|
setCustomId(customId: string): this;
|
|
827
857
|
/**
|
|
828
858
|
* Sets whether or not this select menu is disabled
|
|
829
|
-
*
|
|
859
|
+
*
|
|
860
|
+
* @param disabled - Whether or not this select menu is disabled
|
|
830
861
|
*/
|
|
831
862
|
setDisabled(disabled?: boolean): this;
|
|
832
863
|
/**
|
|
833
864
|
* Adds options to this select menu
|
|
834
|
-
*
|
|
835
|
-
* @
|
|
865
|
+
*
|
|
866
|
+
* @param options - The options to add to this select menu
|
|
836
867
|
*/
|
|
837
868
|
addOptions(...options: RestOrArray<UnsafeSelectMenuOptionBuilder | APISelectMenuOption>): this;
|
|
838
869
|
/**
|
|
839
870
|
* Sets the options on this select menu
|
|
840
|
-
*
|
|
871
|
+
*
|
|
872
|
+
* @param options - The options to set on this select menu
|
|
841
873
|
*/
|
|
842
874
|
setOptions(...options: RestOrArray<UnsafeSelectMenuOptionBuilder | APISelectMenuOption>): this;
|
|
843
875
|
toJSON(): APISelectMenuComponent;
|
|
@@ -865,39 +897,39 @@ declare class SharedNameAndDescription {
|
|
|
865
897
|
/**
|
|
866
898
|
* Sets the name
|
|
867
899
|
*
|
|
868
|
-
* @param name The name
|
|
900
|
+
* @param name - The name
|
|
869
901
|
*/
|
|
870
902
|
setName(name: string): this;
|
|
871
903
|
/**
|
|
872
904
|
* Sets the description
|
|
873
905
|
*
|
|
874
|
-
* @param description The description
|
|
906
|
+
* @param description - The description
|
|
875
907
|
*/
|
|
876
908
|
setDescription(description: string): this;
|
|
877
909
|
/**
|
|
878
910
|
* Sets a name localization
|
|
879
911
|
*
|
|
880
|
-
* @param locale The locale to set a description for
|
|
881
|
-
* @param localizedName The localized description for the given locale
|
|
912
|
+
* @param locale - The locale to set a description for
|
|
913
|
+
* @param localizedName - The localized description for the given locale
|
|
882
914
|
*/
|
|
883
915
|
setNameLocalization(locale: LocaleString, localizedName: string | null): this;
|
|
884
916
|
/**
|
|
885
917
|
* Sets the name localizations
|
|
886
918
|
*
|
|
887
|
-
* @param localizedNames The dictionary of localized descriptions to set
|
|
919
|
+
* @param localizedNames - The dictionary of localized descriptions to set
|
|
888
920
|
*/
|
|
889
921
|
setNameLocalizations(localizedNames: LocalizationMap | null): this;
|
|
890
922
|
/**
|
|
891
923
|
* Sets a description localization
|
|
892
924
|
*
|
|
893
|
-
* @param locale The locale to set a description for
|
|
894
|
-
* @param localizedDescription The localized description for the given locale
|
|
925
|
+
* @param locale - The locale to set a description for
|
|
926
|
+
* @param localizedDescription - The localized description for the given locale
|
|
895
927
|
*/
|
|
896
928
|
setDescriptionLocalization(locale: LocaleString, localizedDescription: string | null): this;
|
|
897
929
|
/**
|
|
898
930
|
* Sets the description localizations
|
|
899
931
|
*
|
|
900
|
-
* @param localizedDescriptions The dictionary of localized descriptions to set
|
|
932
|
+
* @param localizedDescriptions - The dictionary of localized descriptions to set
|
|
901
933
|
*/
|
|
902
934
|
setDescriptionLocalizations(localizedDescriptions: LocalizationMap | null): this;
|
|
903
935
|
}
|
|
@@ -908,7 +940,7 @@ declare abstract class ApplicationCommandOptionBase extends SharedNameAndDescrip
|
|
|
908
940
|
/**
|
|
909
941
|
* Marks the option as required
|
|
910
942
|
*
|
|
911
|
-
* @param required If this option should be required
|
|
943
|
+
* @param required - If this option should be required
|
|
912
944
|
*/
|
|
913
945
|
setRequired(required: boolean): this;
|
|
914
946
|
abstract toJSON(): APIApplicationCommandBasicOption;
|
|
@@ -932,7 +964,7 @@ declare class ApplicationCommandOptionChannelTypesMixin {
|
|
|
932
964
|
/**
|
|
933
965
|
* Adds channel types to this option
|
|
934
966
|
*
|
|
935
|
-
* @param channelTypes The channel types to add
|
|
967
|
+
* @param channelTypes - The channel types to add
|
|
936
968
|
*/
|
|
937
969
|
addChannelTypes(...channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
|
|
938
970
|
}
|
|
@@ -949,12 +981,14 @@ declare abstract class ApplicationCommandNumericOptionMinMaxValueMixin {
|
|
|
949
981
|
readonly min_value?: number;
|
|
950
982
|
/**
|
|
951
983
|
* Sets the maximum number value of this option
|
|
952
|
-
*
|
|
984
|
+
*
|
|
985
|
+
* @param max - The maximum value this option can be
|
|
953
986
|
*/
|
|
954
987
|
abstract setMaxValue(max: number): this;
|
|
955
988
|
/**
|
|
956
989
|
* Sets the minimum number value of this option
|
|
957
|
-
*
|
|
990
|
+
*
|
|
991
|
+
* @param min - The minimum value this option can be
|
|
958
992
|
*/
|
|
959
993
|
abstract setMinValue(min: number): this;
|
|
960
994
|
}
|
|
@@ -966,13 +1000,13 @@ declare class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends
|
|
|
966
1000
|
/**
|
|
967
1001
|
* Adds multiple choices for this option
|
|
968
1002
|
*
|
|
969
|
-
* @param choices The choices to add
|
|
1003
|
+
* @param choices - The choices to add
|
|
970
1004
|
*/
|
|
971
1005
|
addChoices(...choices: APIApplicationCommandOptionChoice<T>[]): this;
|
|
972
1006
|
setChoices<Input extends APIApplicationCommandOptionChoice<T>[]>(...choices: Input): this;
|
|
973
1007
|
/**
|
|
974
1008
|
* Marks the option as autocompletable
|
|
975
|
-
* @param autocomplete If this option should be autocompletable
|
|
1009
|
+
* @param autocomplete - If this option should be autocompletable
|
|
976
1010
|
*/
|
|
977
1011
|
setAutocomplete(autocomplete: boolean): this;
|
|
978
1012
|
}
|
|
@@ -1022,55 +1056,55 @@ declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
|
|
|
1022
1056
|
/**
|
|
1023
1057
|
* Adds a boolean option
|
|
1024
1058
|
*
|
|
1025
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1059
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1026
1060
|
*/
|
|
1027
1061
|
addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1028
1062
|
/**
|
|
1029
1063
|
* Adds a user option
|
|
1030
1064
|
*
|
|
1031
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1065
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1032
1066
|
*/
|
|
1033
1067
|
addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1034
1068
|
/**
|
|
1035
1069
|
* Adds a channel option
|
|
1036
1070
|
*
|
|
1037
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1071
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1038
1072
|
*/
|
|
1039
1073
|
addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1040
1074
|
/**
|
|
1041
1075
|
* Adds a role option
|
|
1042
1076
|
*
|
|
1043
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1077
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1044
1078
|
*/
|
|
1045
1079
|
addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1046
1080
|
/**
|
|
1047
1081
|
* Adds an attachment option
|
|
1048
1082
|
*
|
|
1049
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1083
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1050
1084
|
*/
|
|
1051
1085
|
addAttachmentOption(input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1052
1086
|
/**
|
|
1053
1087
|
* Adds a mentionable option
|
|
1054
1088
|
*
|
|
1055
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1089
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1056
1090
|
*/
|
|
1057
1091
|
addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1058
1092
|
/**
|
|
1059
1093
|
* Adds a string option
|
|
1060
1094
|
*
|
|
1061
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1095
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1062
1096
|
*/
|
|
1063
1097
|
addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'> | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1064
1098
|
/**
|
|
1065
1099
|
* Adds an integer option
|
|
1066
1100
|
*
|
|
1067
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1101
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1068
1102
|
*/
|
|
1069
1103
|
addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'> | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1070
1104
|
/**
|
|
1071
1105
|
* Adds a number option
|
|
1072
1106
|
*
|
|
1073
|
-
* @param input A function that returns an option builder, or an already built builder
|
|
1107
|
+
* @param input - A function that returns an option builder, or an already built builder
|
|
1074
1108
|
*/
|
|
1075
1109
|
addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'> | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
|
|
1076
1110
|
private _sharedAddOptionMethod;
|
|
@@ -1097,7 +1131,7 @@ declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationComm
|
|
|
1097
1131
|
/**
|
|
1098
1132
|
* Adds a new subcommand to this group
|
|
1099
1133
|
*
|
|
1100
|
-
* @param input A function that returns a subcommand builder, or an already built builder
|
|
1134
|
+
* @param input - A function that returns a subcommand builder, or an already built builder
|
|
1101
1135
|
*/
|
|
1102
1136
|
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
|
|
1103
1137
|
toJSON(): APIApplicationCommandSubcommandGroupOption;
|
|
@@ -1175,7 +1209,7 @@ declare class SlashCommandBuilder {
|
|
|
1175
1209
|
*
|
|
1176
1210
|
* **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
|
|
1177
1211
|
*
|
|
1178
|
-
* @param value Whether or not to enable this command by default
|
|
1212
|
+
* @param value - Whether or not to enable this command by default
|
|
1179
1213
|
*
|
|
1180
1214
|
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
|
1181
1215
|
* @deprecated Use `setDefaultMemberPermissions` or `setDMPermission` instead.
|
|
@@ -1186,7 +1220,7 @@ declare class SlashCommandBuilder {
|
|
|
1186
1220
|
*
|
|
1187
1221
|
* **Note:** You can set this to `'0'` to disable the command by default.
|
|
1188
1222
|
*
|
|
1189
|
-
* @param permissions The permissions bit field to set
|
|
1223
|
+
* @param permissions - The permissions bit field to set
|
|
1190
1224
|
*
|
|
1191
1225
|
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
|
1192
1226
|
*/
|
|
@@ -1195,7 +1229,7 @@ declare class SlashCommandBuilder {
|
|
|
1195
1229
|
* Sets if the command is available in DMs with the application, only for globally-scoped commands.
|
|
1196
1230
|
* By default, commands are visible.
|
|
1197
1231
|
*
|
|
1198
|
-
* @param enabled If the command should be enabled in DMs
|
|
1232
|
+
* @param enabled - If the command should be enabled in DMs
|
|
1199
1233
|
*
|
|
1200
1234
|
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
|
1201
1235
|
*/
|
|
@@ -1203,13 +1237,13 @@ declare class SlashCommandBuilder {
|
|
|
1203
1237
|
/**
|
|
1204
1238
|
* Adds a new subcommand group to this command
|
|
1205
1239
|
*
|
|
1206
|
-
* @param input A function that returns a subcommand group builder, or an already built builder
|
|
1240
|
+
* @param input - A function that returns a subcommand group builder, or an already built builder
|
|
1207
1241
|
*/
|
|
1208
1242
|
addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandsOnlyBuilder;
|
|
1209
1243
|
/**
|
|
1210
1244
|
* Adds a new subcommand to this command
|
|
1211
1245
|
*
|
|
1212
|
-
* @param input A function that returns a subcommand builder, or an already built builder
|
|
1246
|
+
* @param input - A function that returns a subcommand builder, or an already built builder
|
|
1213
1247
|
*/
|
|
1214
1248
|
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
|
|
1215
1249
|
}
|
|
@@ -1326,13 +1360,13 @@ declare class ContextMenuCommandBuilder {
|
|
|
1326
1360
|
/**
|
|
1327
1361
|
* Sets the name
|
|
1328
1362
|
*
|
|
1329
|
-
* @param name The name
|
|
1363
|
+
* @param name - The name
|
|
1330
1364
|
*/
|
|
1331
1365
|
setName(name: string): this;
|
|
1332
1366
|
/**
|
|
1333
1367
|
* Sets the type
|
|
1334
1368
|
*
|
|
1335
|
-
* @param type The type
|
|
1369
|
+
* @param type - The type
|
|
1336
1370
|
*/
|
|
1337
1371
|
setType(type: ContextMenuCommandType): this;
|
|
1338
1372
|
/**
|
|
@@ -1340,7 +1374,7 @@ declare class ContextMenuCommandBuilder {
|
|
|
1340
1374
|
*
|
|
1341
1375
|
* **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
|
|
1342
1376
|
*
|
|
1343
|
-
* @param value Whether or not to enable this command by default
|
|
1377
|
+
* @param value - Whether or not to enable this command by default
|
|
1344
1378
|
*
|
|
1345
1379
|
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
|
1346
1380
|
* @deprecated Use `setDefaultMemberPermissions` or `setDMPermission` instead.
|
|
@@ -1351,7 +1385,7 @@ declare class ContextMenuCommandBuilder {
|
|
|
1351
1385
|
*
|
|
1352
1386
|
* **Note:** You can set this to `'0'` to disable the command by default.
|
|
1353
1387
|
*
|
|
1354
|
-
* @param permissions The permissions bit field to set
|
|
1388
|
+
* @param permissions - The permissions bit field to set
|
|
1355
1389
|
*
|
|
1356
1390
|
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
|
1357
1391
|
*/
|
|
@@ -1360,7 +1394,7 @@ declare class ContextMenuCommandBuilder {
|
|
|
1360
1394
|
* Sets if the command is available in DMs with the application, only for globally-scoped commands.
|
|
1361
1395
|
* By default, commands are visible.
|
|
1362
1396
|
*
|
|
1363
|
-
* @param enabled If the command should be enabled in DMs
|
|
1397
|
+
* @param enabled - If the command should be enabled in DMs
|
|
1364
1398
|
*
|
|
1365
1399
|
* @see https://discord.com/developers/docs/interactions/application-commands#permissions
|
|
1366
1400
|
*/
|
|
@@ -1368,14 +1402,14 @@ declare class ContextMenuCommandBuilder {
|
|
|
1368
1402
|
/**
|
|
1369
1403
|
* Sets a name localization
|
|
1370
1404
|
*
|
|
1371
|
-
* @param locale The locale to set a description for
|
|
1372
|
-
* @param localizedName The localized description for the given locale
|
|
1405
|
+
* @param locale - The locale to set a description for
|
|
1406
|
+
* @param localizedName - The localized description for the given locale
|
|
1373
1407
|
*/
|
|
1374
1408
|
setNameLocalization(locale: LocaleString, localizedName: string | null): this;
|
|
1375
1409
|
/**
|
|
1376
1410
|
* Sets the name localizations
|
|
1377
1411
|
*
|
|
1378
|
-
* @param localizedNames The dictionary of localized descriptions to set
|
|
1412
|
+
* @param localizedNames - The dictionary of localized descriptions to set
|
|
1379
1413
|
*/
|
|
1380
1414
|
setNameLocalizations(localizedNames: LocalizationMap | null): this;
|
|
1381
1415
|
/**
|
|
@@ -1419,7 +1453,7 @@ interface Equatable<T> {
|
|
|
1419
1453
|
}
|
|
1420
1454
|
/**
|
|
1421
1455
|
* Indicates if an object is equatable or not.
|
|
1422
|
-
* @param maybeEquatable The object to check against
|
|
1456
|
+
* @param maybeEquatable - The object to check against
|
|
1423
1457
|
*/
|
|
1424
1458
|
declare function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable<unknown>;
|
|
1425
1459
|
|