@discordjs/builders 0.7.0 → 0.9.0

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.
Files changed (93) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +28 -8
  3. package/dist/index.d.ts +850 -17
  4. package/dist/index.js +4 -21
  5. package/dist/index.js.map +7 -1
  6. package/dist/index.mjs +4 -38
  7. package/dist/index.mjs.map +7 -0
  8. package/package.json +54 -42
  9. package/dist/index.d.ts.map +0 -1
  10. package/dist/interactions/contextMenuCommands/Assertions.d.ts +0 -6
  11. package/dist/interactions/contextMenuCommands/Assertions.d.ts.map +0 -1
  12. package/dist/interactions/contextMenuCommands/Assertions.js +0 -32
  13. package/dist/interactions/contextMenuCommands/Assertions.js.map +0 -1
  14. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.d.ts +0 -43
  15. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.d.ts.map +0 -1
  16. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.js +0 -85
  17. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.js.map +0 -1
  18. package/dist/interactions/slashCommands/Assertions.d.ts +0 -12
  19. package/dist/interactions/slashCommands/Assertions.d.ts.map +0 -1
  20. package/dist/interactions/slashCommands/Assertions.js +0 -63
  21. package/dist/interactions/slashCommands/Assertions.js.map +0 -1
  22. package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts +0 -58
  23. package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map +0 -1
  24. package/dist/interactions/slashCommands/SlashCommandBuilder.js +0 -113
  25. package/dist/interactions/slashCommands/SlashCommandBuilder.js.map +0 -1
  26. package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts +0 -54
  27. package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map +0 -1
  28. package/dist/interactions/slashCommands/SlashCommandSubcommands.js +0 -123
  29. package/dist/interactions/slashCommands/SlashCommandSubcommands.js.map +0 -1
  30. package/dist/interactions/slashCommands/mixins/CommandChannelOptionBase.d.ts +0 -18
  31. package/dist/interactions/slashCommands/mixins/CommandChannelOptionBase.d.ts.map +0 -1
  32. package/dist/interactions/slashCommands/mixins/CommandChannelOptionBase.js +0 -58
  33. package/dist/interactions/slashCommands/mixins/CommandChannelOptionBase.js.map +0 -1
  34. package/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts +0 -15
  35. package/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts.map +0 -1
  36. package/dist/interactions/slashCommands/mixins/CommandOptionBase.js +0 -48
  37. package/dist/interactions/slashCommands/mixins/CommandOptionBase.js.map +0 -1
  38. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts +0 -49
  39. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts.map +0 -1
  40. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js +0 -71
  41. package/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js.map +0 -1
  42. package/dist/interactions/slashCommands/mixins/CommandOptions.d.ts +0 -54
  43. package/dist/interactions/slashCommands/mixins/CommandOptions.d.ts.map +0 -1
  44. package/dist/interactions/slashCommands/mixins/CommandOptions.js +0 -91
  45. package/dist/interactions/slashCommands/mixins/CommandOptions.js.map +0 -1
  46. package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts +0 -15
  47. package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map +0 -1
  48. package/dist/interactions/slashCommands/mixins/NameAndDescription.js +0 -42
  49. package/dist/interactions/slashCommands/mixins/NameAndDescription.js.map +0 -1
  50. package/dist/interactions/slashCommands/options/boolean.d.ts +0 -7
  51. package/dist/interactions/slashCommands/options/boolean.d.ts.map +0 -1
  52. package/dist/interactions/slashCommands/options/boolean.js +0 -18
  53. package/dist/interactions/slashCommands/options/boolean.js.map +0 -1
  54. package/dist/interactions/slashCommands/options/channel.d.ts +0 -7
  55. package/dist/interactions/slashCommands/options/channel.d.ts.map +0 -1
  56. package/dist/interactions/slashCommands/options/channel.js +0 -18
  57. package/dist/interactions/slashCommands/options/channel.js.map +0 -1
  58. package/dist/interactions/slashCommands/options/integer.d.ts +0 -7
  59. package/dist/interactions/slashCommands/options/integer.d.ts.map +0 -1
  60. package/dist/interactions/slashCommands/options/integer.js +0 -18
  61. package/dist/interactions/slashCommands/options/integer.js.map +0 -1
  62. package/dist/interactions/slashCommands/options/mentionable.d.ts +0 -7
  63. package/dist/interactions/slashCommands/options/mentionable.d.ts.map +0 -1
  64. package/dist/interactions/slashCommands/options/mentionable.js +0 -18
  65. package/dist/interactions/slashCommands/options/mentionable.js.map +0 -1
  66. package/dist/interactions/slashCommands/options/number.d.ts +0 -7
  67. package/dist/interactions/slashCommands/options/number.d.ts.map +0 -1
  68. package/dist/interactions/slashCommands/options/number.js +0 -18
  69. package/dist/interactions/slashCommands/options/number.js.map +0 -1
  70. package/dist/interactions/slashCommands/options/role.d.ts +0 -7
  71. package/dist/interactions/slashCommands/options/role.d.ts.map +0 -1
  72. package/dist/interactions/slashCommands/options/role.js +0 -18
  73. package/dist/interactions/slashCommands/options/role.js.map +0 -1
  74. package/dist/interactions/slashCommands/options/string.d.ts +0 -7
  75. package/dist/interactions/slashCommands/options/string.d.ts.map +0 -1
  76. package/dist/interactions/slashCommands/options/string.js +0 -18
  77. package/dist/interactions/slashCommands/options/string.js.map +0 -1
  78. package/dist/interactions/slashCommands/options/user.d.ts +0 -7
  79. package/dist/interactions/slashCommands/options/user.d.ts.map +0 -1
  80. package/dist/interactions/slashCommands/options/user.js +0 -18
  81. package/dist/interactions/slashCommands/options/user.js.map +0 -1
  82. package/dist/messages/embed/Assertions.d.ts +0 -23
  83. package/dist/messages/embed/Assertions.d.ts.map +0 -1
  84. package/dist/messages/embed/Assertions.js +0 -26
  85. package/dist/messages/embed/Assertions.js.map +0 -1
  86. package/dist/messages/embed/Embed.d.ts +0 -140
  87. package/dist/messages/embed/Embed.d.ts.map +0 -1
  88. package/dist/messages/embed/Embed.js +0 -300
  89. package/dist/messages/embed/Embed.js.map +0 -1
  90. package/dist/messages/formatters.d.ts +0 -198
  91. package/dist/messages/formatters.d.ts.map +0 -1
  92. package/dist/messages/formatters.js +0 -181
  93. package/dist/messages/formatters.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,17 +1,850 @@
1
- export * as EmbedAssertions from './messages/embed/Assertions';
2
- export * from './messages/embed/Embed';
3
- export * from './messages/formatters';
4
- export * as SlashCommandAssertions from './interactions/slashCommands/Assertions';
5
- export * from './interactions/slashCommands/SlashCommandBuilder';
6
- export * from './interactions/slashCommands/SlashCommandSubcommands';
7
- export * from './interactions/slashCommands/options/boolean';
8
- export * from './interactions/slashCommands/options/channel';
9
- export * from './interactions/slashCommands/options/integer';
10
- export * from './interactions/slashCommands/options/mentionable';
11
- export * from './interactions/slashCommands/options/number';
12
- export * from './interactions/slashCommands/options/role';
13
- export * from './interactions/slashCommands/options/string';
14
- export * from './interactions/slashCommands/options/user';
15
- export * as ContextMenuCommandAssertions from './interactions/contextMenuCommands/Assertions';
16
- export * from './interactions/contextMenuCommands/ContextMenuCommandBuilder';
17
- //# sourceMappingURL=index.d.ts.map
1
+ import * as discord_api_types_v9 from 'discord-api-types/v9';
2
+ import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, ApplicationCommandOptionType, ChannelType, APIApplicationCommandChannelOptions, APIApplicationCommandOptionChoice, APIApplicationCommandSubCommandOptions, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
3
+ import { z } from 'zod';
4
+ import { Snowflake } from 'discord-api-types/globals';
5
+ import { URL } from 'url';
6
+
7
+ declare const fieldNamePredicate: z.ZodString;
8
+ declare const fieldValuePredicate: z.ZodString;
9
+ declare const fieldInlinePredicate: z.ZodOptional<z.ZodBoolean>;
10
+ declare const embedFieldPredicate: z.ZodObject<{
11
+ name: z.ZodString;
12
+ value: z.ZodString;
13
+ inline: z.ZodOptional<z.ZodBoolean>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ inline?: boolean | undefined;
16
+ name: string;
17
+ value: string;
18
+ }, {
19
+ inline?: boolean | undefined;
20
+ name: string;
21
+ value: string;
22
+ }>;
23
+ declare const embedFieldsArrayPredicate: z.ZodArray<z.ZodObject<{
24
+ name: z.ZodString;
25
+ value: z.ZodString;
26
+ inline: z.ZodOptional<z.ZodBoolean>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ inline?: boolean | undefined;
29
+ name: string;
30
+ value: string;
31
+ }, {
32
+ inline?: boolean | undefined;
33
+ name: string;
34
+ value: string;
35
+ }>, "many">;
36
+ declare const fieldLengthPredicate: z.ZodNumber;
37
+ declare function validateFieldLength(fields: APIEmbedField[], amountAdding: number): void;
38
+ declare const authorNamePredicate: z.ZodNullable<z.ZodString>;
39
+ declare const urlPredicate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
40
+ declare const colorPredicate: z.ZodNullable<z.ZodNumber>;
41
+ declare const descriptionPredicate: z.ZodNullable<z.ZodString>;
42
+ declare const footerTextPredicate: z.ZodNullable<z.ZodString>;
43
+ declare const timestampPredicate: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
44
+ declare const titlePredicate: z.ZodNullable<z.ZodString>;
45
+
46
+ declare const Assertions$2_fieldNamePredicate: typeof fieldNamePredicate;
47
+ declare const Assertions$2_fieldValuePredicate: typeof fieldValuePredicate;
48
+ declare const Assertions$2_fieldInlinePredicate: typeof fieldInlinePredicate;
49
+ declare const Assertions$2_embedFieldPredicate: typeof embedFieldPredicate;
50
+ declare const Assertions$2_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
51
+ declare const Assertions$2_fieldLengthPredicate: typeof fieldLengthPredicate;
52
+ declare const Assertions$2_validateFieldLength: typeof validateFieldLength;
53
+ declare const Assertions$2_authorNamePredicate: typeof authorNamePredicate;
54
+ declare const Assertions$2_urlPredicate: typeof urlPredicate;
55
+ declare const Assertions$2_colorPredicate: typeof colorPredicate;
56
+ declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
57
+ declare const Assertions$2_footerTextPredicate: typeof footerTextPredicate;
58
+ declare const Assertions$2_timestampPredicate: typeof timestampPredicate;
59
+ declare const Assertions$2_titlePredicate: typeof titlePredicate;
60
+ declare namespace Assertions$2 {
61
+ export {
62
+ Assertions$2_fieldNamePredicate as fieldNamePredicate,
63
+ Assertions$2_fieldValuePredicate as fieldValuePredicate,
64
+ Assertions$2_fieldInlinePredicate as fieldInlinePredicate,
65
+ Assertions$2_embedFieldPredicate as embedFieldPredicate,
66
+ Assertions$2_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
67
+ Assertions$2_fieldLengthPredicate as fieldLengthPredicate,
68
+ Assertions$2_validateFieldLength as validateFieldLength,
69
+ Assertions$2_authorNamePredicate as authorNamePredicate,
70
+ Assertions$2_urlPredicate as urlPredicate,
71
+ Assertions$2_colorPredicate as colorPredicate,
72
+ Assertions$2_descriptionPredicate as descriptionPredicate,
73
+ Assertions$2_footerTextPredicate as footerTextPredicate,
74
+ Assertions$2_timestampPredicate as timestampPredicate,
75
+ Assertions$2_titlePredicate as titlePredicate,
76
+ };
77
+ }
78
+
79
+ interface AuthorOptions {
80
+ name: string;
81
+ url?: string;
82
+ iconURL?: string;
83
+ }
84
+ interface FooterOptions {
85
+ text: string;
86
+ iconURL?: string;
87
+ }
88
+ /**
89
+ * Represents an embed in a message (image/video preview, rich embed, etc.)
90
+ */
91
+ declare class Embed implements APIEmbed {
92
+ /**
93
+ * An array of fields of this embed
94
+ */
95
+ fields: APIEmbedField[];
96
+ /**
97
+ * The embed title
98
+ */
99
+ title?: string;
100
+ /**
101
+ * The embed description
102
+ */
103
+ description?: string;
104
+ /**
105
+ * The embed url
106
+ */
107
+ url?: string;
108
+ /**
109
+ * The embed color
110
+ */
111
+ color?: number;
112
+ /**
113
+ * The timestamp of the embed in the ISO format
114
+ */
115
+ timestamp?: string;
116
+ /**
117
+ * The embed thumbnail data
118
+ */
119
+ thumbnail?: APIEmbedThumbnail;
120
+ /**
121
+ * The embed image data
122
+ */
123
+ image?: APIEmbedImage;
124
+ /**
125
+ * Received video data
126
+ */
127
+ video?: APIEmbedVideo;
128
+ /**
129
+ * The embed author data
130
+ */
131
+ author?: APIEmbedAuthor;
132
+ /**
133
+ * Received data about the embed provider
134
+ */
135
+ provider?: APIEmbedProvider;
136
+ /**
137
+ * The embed footer data
138
+ */
139
+ footer?: APIEmbedFooter;
140
+ constructor(data?: APIEmbed);
141
+ /**
142
+ * The accumulated length for the embed title, description, fields, footer text, and author name
143
+ */
144
+ get length(): number;
145
+ /**
146
+ * Adds a field to the embed (max 25)
147
+ *
148
+ * @param field The field to add.
149
+ */
150
+ addField(field: APIEmbedField): this;
151
+ /**
152
+ * Adds fields to the embed (max 25)
153
+ *
154
+ * @param fields The fields to add
155
+ */
156
+ addFields(...fields: APIEmbedField[]): this;
157
+ /**
158
+ * Removes, replaces, or inserts fields in the embed (max 25)
159
+ *
160
+ * @param index The index to start at
161
+ * @param deleteCount The number of fields to remove
162
+ * @param fields The replacing field objects
163
+ */
164
+ spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
165
+ /**
166
+ * Sets the author of this embed
167
+ *
168
+ * @param options The options for the author
169
+ */
170
+ setAuthor(options: AuthorOptions | null): this;
171
+ /**
172
+ * Sets the color of this embed
173
+ *
174
+ * @param color The color of the embed
175
+ */
176
+ setColor(color: number | null): this;
177
+ /**
178
+ * Sets the description of this embed
179
+ *
180
+ * @param description The description
181
+ */
182
+ setDescription(description: string | null): this;
183
+ /**
184
+ * Sets the footer of this embed
185
+ *
186
+ * @param options The options for the footer
187
+ */
188
+ setFooter(options: FooterOptions | null): this;
189
+ /**
190
+ * Sets the image of this embed
191
+ *
192
+ * @param url The URL of the image
193
+ */
194
+ setImage(url: string | null): this;
195
+ /**
196
+ * Sets the thumbnail of this embed
197
+ *
198
+ * @param url The URL of the thumbnail
199
+ */
200
+ setThumbnail(url: string | null): this;
201
+ /**
202
+ * Sets the timestamp of this embed
203
+ *
204
+ * @param timestamp The timestamp or date
205
+ */
206
+ setTimestamp(timestamp?: number | Date | null): this;
207
+ /**
208
+ * Sets the title of this embed
209
+ *
210
+ * @param title The title
211
+ */
212
+ setTitle(title: string | null): this;
213
+ /**
214
+ * Sets the URL of this embed
215
+ *
216
+ * @param url The URL
217
+ */
218
+ setURL(url: string | null): this;
219
+ /**
220
+ * Transforms the embed to a plain object
221
+ */
222
+ toJSON(): APIEmbed;
223
+ /**
224
+ * Normalizes field input and resolves strings
225
+ *
226
+ * @param fields Fields to normalize
227
+ */
228
+ static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[];
229
+ }
230
+
231
+ /**
232
+ * Wraps the content inside a codeblock with no language
233
+ *
234
+ * @param content The content to wrap
235
+ */
236
+ declare function codeBlock<C extends string>(content: C): `\`\`\`\n${C}\`\`\``;
237
+ /**
238
+ * Wraps the content inside a codeblock with the specified language
239
+ *
240
+ * @param language The language for the codeblock
241
+ * @param content The content to wrap
242
+ */
243
+ declare function codeBlock<L extends string, C extends string>(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``;
244
+ /**
245
+ * Wraps the content inside \`backticks\`, which formats it as inline code
246
+ *
247
+ * @param content The content to wrap
248
+ */
249
+ declare function inlineCode<C extends string>(content: C): `\`${C}\``;
250
+ /**
251
+ * Formats the content into italic text
252
+ *
253
+ * @param content The content to wrap
254
+ */
255
+ declare function italic<C extends string>(content: C): `_${C}_`;
256
+ /**
257
+ * Formats the content into bold text
258
+ *
259
+ * @param content The content to wrap
260
+ */
261
+ declare function bold<C extends string>(content: C): `**${C}**`;
262
+ /**
263
+ * Formats the content into underscored text
264
+ *
265
+ * @param content The content to wrap
266
+ */
267
+ declare function underscore<C extends string>(content: C): `__${C}__`;
268
+ /**
269
+ * Formats the content into strike-through text
270
+ *
271
+ * @param content The content to wrap
272
+ */
273
+ declare function strikethrough<C extends string>(content: C): `~~${C}~~`;
274
+ /**
275
+ * Formats the content into a quote. This needs to be at the start of the line for Discord to format it
276
+ *
277
+ * @param content The content to wrap
278
+ */
279
+ declare function quote<C extends string>(content: C): `> ${C}`;
280
+ /**
281
+ * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it
282
+ *
283
+ * @param content The content to wrap
284
+ */
285
+ declare function blockQuote<C extends string>(content: C): `>>> ${C}`;
286
+ /**
287
+ * Wraps the URL into `<>`, which stops it from embedding
288
+ *
289
+ * @param url The URL to wrap
290
+ */
291
+ declare function hideLinkEmbed<C extends string>(url: C): `<${C}>`;
292
+ /**
293
+ * Wraps the URL into `<>`, which stops it from embedding
294
+ *
295
+ * @param url The URL to wrap
296
+ */
297
+ declare function hideLinkEmbed(url: URL): `<${string}>`;
298
+ /**
299
+ * Formats the content and the URL into a masked URL
300
+ *
301
+ * @param content The content to display
302
+ * @param url The URL the content links to
303
+ */
304
+ declare function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;
305
+ /**
306
+ * Formats the content and the URL into a masked URL
307
+ *
308
+ * @param content The content to display
309
+ * @param url The URL the content links to
310
+ */
311
+ declare function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;
312
+ /**
313
+ * Formats the content and the URL into a masked URL
314
+ *
315
+ * @param content The content to display
316
+ * @param url The URL the content links to
317
+ * @param title The title shown when hovering on the masked link
318
+ */
319
+ declare function hyperlink<C extends string, T extends string>(content: C, url: URL, title: T): `[${C}](${string} "${T}")`;
320
+ /**
321
+ * Formats the content and the URL into a masked URL
322
+ *
323
+ * @param content The content to display
324
+ * @param url The URL the content links to
325
+ * @param title The title shown when hovering on the masked link
326
+ */
327
+ declare function hyperlink<C extends string, U extends string, T extends string>(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
328
+ /**
329
+ * Wraps the content inside spoiler (hidden text)
330
+ *
331
+ * @param content The content to wrap
332
+ */
333
+ declare function spoiler<C extends string>(content: C): `||${C}||`;
334
+ /**
335
+ * Formats a user ID into a user mention
336
+ *
337
+ * @param userId The user ID to format
338
+ */
339
+ declare function userMention<C extends Snowflake>(userId: C): `<@${C}>`;
340
+ /**
341
+ * Formats a user ID into a member-nickname mention
342
+ *
343
+ * @param memberId The user ID to format
344
+ */
345
+ declare function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>`;
346
+ /**
347
+ * Formats a channel ID into a channel mention
348
+ *
349
+ * @param channelId The channel ID to format
350
+ */
351
+ declare function channelMention<C extends Snowflake>(channelId: C): `<#${C}>`;
352
+ /**
353
+ * Formats a role ID into a role mention
354
+ *
355
+ * @param roleId The role ID to format
356
+ */
357
+ declare function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>`;
358
+ /**
359
+ * Formats an emoji ID into a fully qualified emoji identifier
360
+ *
361
+ * @param emojiId The emoji ID to format
362
+ */
363
+ declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;
364
+ /**
365
+ * Formats an emoji ID into a fully qualified emoji identifier
366
+ *
367
+ * @param emojiId The emoji ID to format
368
+ * @param animated Whether the emoji is animated or not. Defaults to `false`
369
+ */
370
+ declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;
371
+ /**
372
+ * Formats a date into a short date-time string
373
+ *
374
+ * @param date The date to format, defaults to the current time
375
+ */
376
+ declare function time(date?: Date): `<t:${bigint}>`;
377
+ /**
378
+ * Formats a date given a format style
379
+ *
380
+ * @param date The date to format
381
+ * @param style The style to use
382
+ */
383
+ declare function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;
384
+ /**
385
+ * Formats the given timestamp into a short date-time string
386
+ *
387
+ * @param seconds The time to format, represents an UNIX timestamp in seconds
388
+ */
389
+ declare function time<C extends number>(seconds: C): `<t:${C}>`;
390
+ /**
391
+ * Formats the given timestamp into a short date-time string
392
+ *
393
+ * @param seconds The time to format, represents an UNIX timestamp in seconds
394
+ * @param style The style to use
395
+ */
396
+ declare function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;
397
+ /**
398
+ * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord
399
+ */
400
+ declare const TimestampStyles: {
401
+ /**
402
+ * Short time format, consisting of hours and minutes, e.g. 16:20
403
+ */
404
+ readonly ShortTime: "t";
405
+ /**
406
+ * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30
407
+ */
408
+ readonly LongTime: "T";
409
+ /**
410
+ * Short date format, consisting of day, month, and year, e.g. 20/04/2021
411
+ */
412
+ readonly ShortDate: "d";
413
+ /**
414
+ * Long date format, consisting of day, month, and year, e.g. 20 April 2021
415
+ */
416
+ readonly LongDate: "D";
417
+ /**
418
+ * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20
419
+ */
420
+ readonly ShortDateTime: "f";
421
+ /**
422
+ * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20
423
+ */
424
+ readonly LongDateTime: "F";
425
+ /**
426
+ * Relative time format, consisting of a relative duration format, e.g. 2 months ago
427
+ */
428
+ readonly RelativeTime: "R";
429
+ };
430
+ /**
431
+ * The possible values, see {@link TimestampStyles} for more information
432
+ */
433
+ declare type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];
434
+ /**
435
+ * An enum with all the available faces from Discord's native slash commands
436
+ */
437
+ declare enum Faces {
438
+ /**
439
+ * ¯\\_(ツ)\\_/¯
440
+ */
441
+ Shrug = "\u00AF\\_(\u30C4)\\_/\u00AF",
442
+ /**
443
+ * (╯°□°)╯︵ ┻━┻
444
+ */
445
+ Tableflip = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B",
446
+ /**
447
+ * ┬─┬ ノ( ゜-゜ノ)
448
+ */
449
+ Unflip = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)"
450
+ }
451
+
452
+ declare class SlashCommandBooleanOption extends SlashCommandOptionBase {
453
+ readonly type: ApplicationCommandOptionType.Boolean;
454
+ constructor();
455
+ }
456
+
457
+ declare abstract class ApplicationCommandOptionWithChannelTypesBase extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions {
458
+ channelTypes?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
459
+ /**
460
+ * Adds a channel type to this option
461
+ *
462
+ * @param channelType The type of channel to allow
463
+ */
464
+ addChannelType(channelType: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>): this;
465
+ /**
466
+ * Adds channel types to this option
467
+ *
468
+ * @param channelTypes The channel types to add
469
+ */
470
+ addChannelTypes(channelTypes: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[]): this;
471
+ toJSON(): APIApplicationCommandChannelOptions;
472
+ }
473
+
474
+ declare class SlashCommandChannelOption extends ApplicationCommandOptionWithChannelTypesBase {
475
+ readonly type: ApplicationCommandOptionType.Channel;
476
+ constructor();
477
+ }
478
+
479
+ declare abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number> extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions {
480
+ choices?: APIApplicationCommandOptionChoice[];
481
+ readonly autocomplete?: boolean;
482
+ /**
483
+ * Adds a choice for this option
484
+ *
485
+ * @param name The name of the choice
486
+ * @param value The value of the choice
487
+ */
488
+ addChoice(name: string, value: T): Omit<this, 'setAutocomplete'>;
489
+ /**
490
+ * Adds multiple choices for this option
491
+ *
492
+ * @param choices The choices to add
493
+ */
494
+ addChoices(choices: [name: string, value: T][]): Omit<this, 'setAutocomplete'>;
495
+ /**
496
+ * Marks the option as autocompletable
497
+ * @param autocomplete If this option should be autocompletable
498
+ */
499
+ setAutocomplete<U extends boolean>(autocomplete: U): U extends true ? Omit<this, 'addChoice' | 'addChoices'> : this & Pick<ApplicationCommandOptionWithChoicesBase<T>, 'addChoice' | 'addChoices'>;
500
+ toJSON(): {
501
+ choices: APIApplicationCommandOptionChoice[] | undefined;
502
+ autocomplete: boolean | undefined;
503
+ type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
504
+ name: string;
505
+ description: string;
506
+ default?: boolean | undefined;
507
+ required?: boolean | undefined;
508
+ } | {
509
+ choices: APIApplicationCommandOptionChoice[] | undefined;
510
+ autocomplete: boolean | undefined;
511
+ type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup;
512
+ options?: discord_api_types_v9.APIApplicationCommandOption[] | undefined;
513
+ name: string;
514
+ description: string;
515
+ default?: boolean | undefined;
516
+ required?: boolean | undefined;
517
+ } | {
518
+ choices: APIApplicationCommandOptionChoice[] | undefined;
519
+ autocomplete: boolean | undefined;
520
+ type: ApplicationCommandOptionType.Channel;
521
+ channel_types?: (discord_api_types_v9.ChannelType.GuildText | discord_api_types_v9.ChannelType.GuildVoice | discord_api_types_v9.ChannelType.GuildCategory | discord_api_types_v9.ChannelType.GuildNews | discord_api_types_v9.ChannelType.GuildStore | discord_api_types_v9.ChannelType.GuildNewsThread | discord_api_types_v9.ChannelType.GuildPublicThread | discord_api_types_v9.ChannelType.GuildPrivateThread | discord_api_types_v9.ChannelType.GuildStageVoice)[] | undefined;
522
+ name: string;
523
+ description: string;
524
+ default?: boolean | undefined;
525
+ required?: boolean | undefined;
526
+ } | {
527
+ choices: APIApplicationCommandOptionChoice[] | undefined;
528
+ autocomplete: boolean | undefined;
529
+ type: ApplicationCommandOptionType.Boolean | ApplicationCommandOptionType.User | ApplicationCommandOptionType.Role | ApplicationCommandOptionType.Mentionable;
530
+ name: string;
531
+ description: string;
532
+ default?: boolean | undefined;
533
+ required?: boolean | undefined;
534
+ };
535
+ }
536
+
537
+ declare class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase<number> {
538
+ readonly type: ApplicationCommandOptionType.Integer;
539
+ constructor();
540
+ }
541
+
542
+ declare class SlashCommandMentionableOption extends SlashCommandOptionBase {
543
+ readonly type: ApplicationCommandOptionType.Mentionable;
544
+ constructor();
545
+ }
546
+
547
+ declare class SlashCommandNumberOption extends ApplicationCommandOptionWithChoicesBase<number> {
548
+ readonly type: ApplicationCommandOptionType.Number;
549
+ constructor();
550
+ }
551
+
552
+ declare class SlashCommandRoleOption extends SlashCommandOptionBase {
553
+ readonly type: ApplicationCommandOptionType.Role;
554
+ constructor();
555
+ }
556
+
557
+ declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> {
558
+ readonly type: ApplicationCommandOptionType.String;
559
+ constructor();
560
+ }
561
+
562
+ declare class SlashCommandUserOption extends SlashCommandOptionBase {
563
+ readonly type: ApplicationCommandOptionType.User;
564
+ constructor();
565
+ }
566
+
567
+ declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
568
+ readonly options: ToAPIApplicationCommandOptions[];
569
+ /**
570
+ * Adds a boolean option
571
+ *
572
+ * @param input A function that returns an option builder, or an already built builder
573
+ */
574
+ addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
575
+ /**
576
+ * Adds a user option
577
+ *
578
+ * @param input A function that returns an option builder, or an already built builder
579
+ */
580
+ addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
581
+ /**
582
+ * Adds a channel option
583
+ *
584
+ * @param input A function that returns an option builder, or an already built builder
585
+ */
586
+ addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
587
+ /**
588
+ * Adds a role option
589
+ *
590
+ * @param input A function that returns an option builder, or an already built builder
591
+ */
592
+ addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
593
+ /**
594
+ * Adds a mentionable option
595
+ *
596
+ * @param input A function that returns an option builder, or an already built builder
597
+ */
598
+ addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
599
+ /**
600
+ * Adds a string option
601
+ *
602
+ * @param input A function that returns an option builder, or an already built builder
603
+ */
604
+ addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'> | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
605
+ /**
606
+ * Adds an integer option
607
+ *
608
+ * @param input A function that returns an option builder, or an already built builder
609
+ */
610
+ addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'> | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
611
+ /**
612
+ * Adds a number option
613
+ *
614
+ * @param input A function that returns an option builder, or an already built builder
615
+ */
616
+ addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'> | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
617
+ private _sharedAddOptionMethod;
618
+ }
619
+
620
+ declare class SharedNameAndDescription {
621
+ readonly name: string;
622
+ readonly description: string;
623
+ /**
624
+ * Sets the name
625
+ *
626
+ * @param name The name
627
+ */
628
+ setName(name: string): this;
629
+ /**
630
+ * Sets the description
631
+ *
632
+ * @param description The description
633
+ */
634
+ setDescription(description: string): this;
635
+ }
636
+
637
+ /**
638
+ * Represents a folder for subcommands
639
+ *
640
+ * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
641
+ */
642
+ declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {
643
+ /**
644
+ * The name of this subcommand group
645
+ */
646
+ readonly name: string;
647
+ /**
648
+ * The description of this subcommand group
649
+ */
650
+ readonly description: string;
651
+ /**
652
+ * The subcommands part of this subcommand group
653
+ */
654
+ readonly options: ToAPIApplicationCommandOptions[];
655
+ /**
656
+ * Adds a new subcommand to this group
657
+ *
658
+ * @param input A function that returns a subcommand builder, or an already built builder
659
+ */
660
+ addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
661
+ toJSON(): APIApplicationCommandSubCommandOptions;
662
+ }
663
+ interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {
664
+ }
665
+ /**
666
+ * Represents a subcommand
667
+ *
668
+ * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
669
+ */
670
+ declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {
671
+ /**
672
+ * The name of this subcommand
673
+ */
674
+ readonly name: string;
675
+ /**
676
+ * The description of this subcommand
677
+ */
678
+ readonly description: string;
679
+ /**
680
+ * The options of this subcommand
681
+ */
682
+ readonly options: ToAPIApplicationCommandOptions[];
683
+ toJSON(): APIApplicationCommandSubCommandOptions;
684
+ }
685
+ interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {
686
+ }
687
+
688
+ declare class SlashCommandBuilder {
689
+ /**
690
+ * The name of this slash command
691
+ */
692
+ readonly name: string;
693
+ /**
694
+ * The description of this slash command
695
+ */
696
+ readonly description: string;
697
+ /**
698
+ * The options of this slash command
699
+ */
700
+ readonly options: ToAPIApplicationCommandOptions[];
701
+ /**
702
+ * Whether the command is enabled by default when the app is added to a guild
703
+ *
704
+ * @default true
705
+ */
706
+ readonly defaultPermission: boolean | undefined;
707
+ /**
708
+ * Returns the final data that should be sent to Discord.
709
+ *
710
+ * **Note:** Calling this function will validate required properties based on their conditions.
711
+ */
712
+ toJSON(): RESTPostAPIApplicationCommandsJSONBody;
713
+ /**
714
+ * Sets whether the command is enabled by default when the application is added to a guild.
715
+ *
716
+ * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
717
+ *
718
+ * @param value Whether or not to enable this command by default
719
+ *
720
+ * @see https://discord.com/developers/docs/interactions/application-commands#permissions
721
+ */
722
+ setDefaultPermission(value: boolean): this;
723
+ /**
724
+ * Adds a new subcommand group to this command
725
+ *
726
+ * @param input A function that returns a subcommand group builder, or an already built builder
727
+ */
728
+ addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandsOnlyBuilder;
729
+ /**
730
+ * Adds a new subcommand to this command
731
+ *
732
+ * @param input A function that returns a subcommand builder, or an already built builder
733
+ */
734
+ addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
735
+ }
736
+ interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {
737
+ }
738
+ interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, Pick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {
739
+ }
740
+ interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick<SlashCommandBuilder, 'toJSON'> {
741
+ }
742
+ interface ToAPIApplicationCommandOptions {
743
+ toJSON(): APIApplicationCommandOption;
744
+ }
745
+
746
+ declare class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {
747
+ required: boolean;
748
+ readonly type: ApplicationCommandOptionType;
749
+ constructor(type: ApplicationCommandOptionType);
750
+ /**
751
+ * Marks the option as required
752
+ *
753
+ * @param required If this option should be required
754
+ */
755
+ setRequired(required: boolean): this;
756
+ toJSON(): APIApplicationCommandOption;
757
+ }
758
+
759
+ declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
760
+ declare function validateName$1(name: unknown): asserts name is string;
761
+ declare function validateDescription(description: unknown): asserts description is string;
762
+ declare function validateDefaultPermission$1(value: unknown): asserts value is boolean;
763
+ declare function validateRequired(required: unknown): asserts required is boolean;
764
+ declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
765
+ declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;
766
+ declare function assertReturnOfBuilder<T extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
767
+
768
+ declare const Assertions$1_validateDescription: typeof validateDescription;
769
+ declare const Assertions$1_validateRequired: typeof validateRequired;
770
+ declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
771
+ declare const Assertions$1_validateMaxChoicesLength: typeof validateMaxChoicesLength;
772
+ declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;
773
+ declare namespace Assertions$1 {
774
+ export {
775
+ validateRequiredParameters$1 as validateRequiredParameters,
776
+ validateName$1 as validateName,
777
+ Assertions$1_validateDescription as validateDescription,
778
+ validateDefaultPermission$1 as validateDefaultPermission,
779
+ Assertions$1_validateRequired as validateRequired,
780
+ Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
781
+ Assertions$1_validateMaxChoicesLength as validateMaxChoicesLength,
782
+ Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,
783
+ };
784
+ }
785
+
786
+ declare class ContextMenuCommandBuilder {
787
+ /**
788
+ * The name of this context menu command
789
+ */
790
+ readonly name: string;
791
+ /**
792
+ * The type of this context menu command
793
+ */
794
+ readonly type: ContextMenuCommandType;
795
+ /**
796
+ * Whether the command is enabled by default when the app is added to a guild
797
+ *
798
+ * @default true
799
+ */
800
+ readonly defaultPermission: boolean | undefined;
801
+ /**
802
+ * Sets the name
803
+ *
804
+ * @param name The name
805
+ */
806
+ setName(name: string): this;
807
+ /**
808
+ * Sets the type
809
+ *
810
+ * @param type The type
811
+ */
812
+ setType(type: ContextMenuCommandType): this;
813
+ /**
814
+ * Sets whether the command is enabled by default when the application is added to a guild.
815
+ *
816
+ * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
817
+ *
818
+ * @param value Whether or not to enable this command by default
819
+ *
820
+ * @see https://discord.com/developers/docs/interactions/application-commands#permissions
821
+ */
822
+ setDefaultPermission(value: boolean): this;
823
+ /**
824
+ * Returns the final data that should be sent to Discord.
825
+ *
826
+ * **Note:** Calling this function will validate required properties based on their conditions.
827
+ */
828
+ toJSON(): RESTPostAPIApplicationCommandsJSONBody;
829
+ }
830
+ declare type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;
831
+
832
+ declare function validateRequiredParameters(name: string, type: number): void;
833
+ declare function validateName(name: unknown): asserts name is string;
834
+ declare function validateType(type: unknown): asserts type is ContextMenuCommandType;
835
+ declare function validateDefaultPermission(value: unknown): asserts value is boolean;
836
+
837
+ declare const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
838
+ declare const Assertions_validateName: typeof validateName;
839
+ declare const Assertions_validateType: typeof validateType;
840
+ declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
841
+ declare namespace Assertions {
842
+ export {
843
+ Assertions_validateRequiredParameters as validateRequiredParameters,
844
+ Assertions_validateName as validateName,
845
+ Assertions_validateType as validateType,
846
+ Assertions_validateDefaultPermission as validateDefaultPermission,
847
+ };
848
+ }
849
+
850
+ export { AuthorOptions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$2 as EmbedAssertions, Faces, FooterOptions, Assertions$1 as SlashCommandAssertions, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, blockQuote, bold, channelMention, codeBlock, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, italic, memberNicknameMention, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };