@discordjs/builders 1.1.0-dev.1658102995-dda2895 → 1.1.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 (245) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +5 -2
  3. package/dist/components/ActionRow.cjs +32 -0
  4. package/dist/components/ActionRow.cjs.map +1 -0
  5. package/dist/components/ActionRow.d.ts +35 -0
  6. package/dist/components/ActionRow.d.ts.map +1 -0
  7. package/dist/components/ActionRow.mjs +28 -0
  8. package/dist/components/ActionRow.mjs.map +1 -0
  9. package/dist/components/Assertions.cjs +77 -0
  10. package/dist/components/Assertions.cjs.map +1 -0
  11. package/dist/components/Assertions.d.ts +48 -0
  12. package/dist/components/Assertions.d.ts.map +1 -0
  13. package/dist/components/Assertions.mjs +57 -0
  14. package/dist/components/Assertions.mjs.map +1 -0
  15. package/dist/components/Component.cjs +12 -0
  16. package/dist/components/Component.cjs.map +1 -0
  17. package/dist/components/Component.d.ts +15 -0
  18. package/dist/components/Component.d.ts.map +1 -0
  19. package/dist/components/Component.mjs +8 -0
  20. package/dist/components/Component.mjs.map +1 -0
  21. package/dist/components/Components.cjs +31 -0
  22. package/dist/components/Components.cjs.map +1 -0
  23. package/dist/components/Components.d.ts +21 -0
  24. package/dist/components/Components.d.ts.map +1 -0
  25. package/dist/components/Components.mjs +27 -0
  26. package/dist/components/Components.mjs.map +1 -0
  27. package/dist/components/button/Button.cjs +46 -0
  28. package/dist/components/button/Button.cjs.map +1 -0
  29. package/dist/components/button/Button.d.ts +46 -0
  30. package/dist/components/button/Button.d.ts.map +1 -0
  31. package/dist/components/button/Button.mjs +42 -0
  32. package/dist/components/button/Button.mjs.map +1 -0
  33. package/dist/components/selectMenu/SelectMenu.cjs +59 -0
  34. package/dist/components/selectMenu/SelectMenu.cjs.map +1 -0
  35. package/dist/components/selectMenu/SelectMenu.d.ts +59 -0
  36. package/dist/components/selectMenu/SelectMenu.d.ts.map +1 -0
  37. package/dist/components/selectMenu/SelectMenu.mjs +55 -0
  38. package/dist/components/selectMenu/SelectMenu.mjs.map +1 -0
  39. package/dist/components/selectMenu/SelectMenuOption.cjs +40 -0
  40. package/dist/components/selectMenu/SelectMenuOption.cjs.map +1 -0
  41. package/dist/components/selectMenu/SelectMenuOption.d.ts +40 -0
  42. package/dist/components/selectMenu/SelectMenuOption.d.ts.map +1 -0
  43. package/dist/components/selectMenu/SelectMenuOption.mjs +36 -0
  44. package/dist/components/selectMenu/SelectMenuOption.mjs.map +1 -0
  45. package/dist/components/textInput/Assertions.cjs +31 -0
  46. package/dist/components/textInput/Assertions.cjs.map +1 -0
  47. package/dist/components/textInput/Assertions.d.ts +10 -0
  48. package/dist/components/textInput/Assertions.d.ts.map +1 -0
  49. package/dist/components/textInput/Assertions.mjs +20 -0
  50. package/dist/components/textInput/Assertions.mjs.map +1 -0
  51. package/dist/components/textInput/TextInput.cjs +67 -0
  52. package/dist/components/textInput/TextInput.cjs.map +1 -0
  53. package/dist/components/textInput/TextInput.d.ts +59 -0
  54. package/dist/components/textInput/TextInput.d.ts.map +1 -0
  55. package/dist/components/textInput/TextInput.mjs +59 -0
  56. package/dist/components/textInput/TextInput.mjs.map +1 -0
  57. package/dist/index.cjs +129 -0
  58. package/dist/index.cjs.map +1 -0
  59. package/dist/index.d.ts +40 -1406
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.mjs +46 -1482
  62. package/dist/index.mjs.map +1 -1
  63. package/dist/interactions/contextMenuCommands/Assertions.cjs +40 -0
  64. package/dist/interactions/contextMenuCommands/Assertions.cjs.map +1 -0
  65. package/dist/interactions/contextMenuCommands/Assertions.d.ts +8 -0
  66. package/dist/interactions/contextMenuCommands/Assertions.d.ts.map +1 -0
  67. package/dist/interactions/contextMenuCommands/Assertions.mjs +31 -0
  68. package/dist/interactions/contextMenuCommands/Assertions.mjs.map +1 -0
  69. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.cjs +71 -0
  70. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.cjs.map +1 -0
  71. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.d.ts +94 -0
  72. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.d.ts.map +1 -0
  73. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.mjs +67 -0
  74. package/dist/interactions/contextMenuCommands/ContextMenuCommandBuilder.mjs.map +1 -0
  75. package/dist/interactions/modals/Assertions.cjs +21 -0
  76. package/dist/interactions/modals/Assertions.cjs.map +1 -0
  77. package/dist/interactions/modals/Assertions.d.ts +5 -0
  78. package/dist/interactions/modals/Assertions.d.ts.map +1 -0
  79. package/dist/interactions/modals/Assertions.mjs +15 -0
  80. package/dist/interactions/modals/Assertions.mjs.map +1 -0
  81. package/dist/interactions/modals/Modal.cjs +43 -0
  82. package/dist/interactions/modals/Modal.cjs.map +1 -0
  83. package/dist/interactions/modals/Modal.d.ts +35 -0
  84. package/dist/interactions/modals/Modal.d.ts.map +1 -0
  85. package/dist/interactions/modals/Modal.mjs +39 -0
  86. package/dist/interactions/modals/Modal.mjs.map +1 -0
  87. package/dist/interactions/slashCommands/Assertions.cjs +70 -0
  88. package/dist/interactions/slashCommands/Assertions.cjs.map +1 -0
  89. package/dist/interactions/slashCommands/Assertions.d.ts +18 -0
  90. package/dist/interactions/slashCommands/Assertions.d.ts.map +1 -0
  91. package/dist/interactions/slashCommands/Assertions.mjs +54 -0
  92. package/dist/interactions/slashCommands/Assertions.mjs.map +1 -0
  93. package/dist/interactions/slashCommands/SlashCommandBuilder.cjs +75 -0
  94. package/dist/interactions/slashCommands/SlashCommandBuilder.cjs.map +1 -0
  95. package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts +100 -0
  96. package/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map +1 -0
  97. package/dist/interactions/slashCommands/SlashCommandBuilder.mjs +73 -0
  98. package/dist/interactions/slashCommands/SlashCommandBuilder.mjs.map +1 -0
  99. package/dist/interactions/slashCommands/SlashCommandSubcommands.cjs +72 -0
  100. package/dist/interactions/slashCommands/SlashCommandSubcommands.cjs.map +1 -0
  101. package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts +56 -0
  102. package/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map +1 -0
  103. package/dist/interactions/slashCommands/SlashCommandSubcommands.mjs +70 -0
  104. package/dist/interactions/slashCommands/SlashCommandSubcommands.mjs.map +1 -0
  105. package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.cjs +9 -0
  106. package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.cjs.map +1 -0
  107. package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.d.ts +17 -0
  108. package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.d.ts.map +1 -0
  109. package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.mjs +5 -0
  110. package/dist/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.mjs.map +1 -0
  111. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.cjs +27 -0
  112. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.cjs.map +1 -0
  113. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.d.ts +15 -0
  114. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.d.ts.map +1 -0
  115. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.mjs +23 -0
  116. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionBase.mjs.map +1 -0
  117. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.cjs +30 -0
  118. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.cjs.map +1 -0
  119. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.d.ts +14 -0
  120. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.d.ts.map +1 -0
  121. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.mjs +26 -0
  122. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.mjs.map +1 -0
  123. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.cjs +57 -0
  124. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.cjs.map +1 -0
  125. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.d.ts +19 -0
  126. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.d.ts.map +1 -0
  127. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.mjs +53 -0
  128. package/dist/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.mjs.map +1 -0
  129. package/dist/interactions/slashCommands/mixins/NameAndDescription.cjs +65 -0
  130. package/dist/interactions/slashCommands/mixins/NameAndDescription.cjs.map +1 -0
  131. package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts +46 -0
  132. package/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map +1 -0
  133. package/dist/interactions/slashCommands/mixins/NameAndDescription.mjs +61 -0
  134. package/dist/interactions/slashCommands/mixins/NameAndDescription.mjs.map +1 -0
  135. package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.cjs +55 -0
  136. package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.cjs.map +1 -0
  137. package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.d.ts +69 -0
  138. package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.d.ts.map +1 -0
  139. package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.mjs +51 -0
  140. package/dist/interactions/slashCommands/mixins/SharedSlashCommandOptions.mjs.map +1 -0
  141. package/dist/interactions/slashCommands/options/attachment.cjs +20 -0
  142. package/dist/interactions/slashCommands/options/attachment.cjs.map +1 -0
  143. package/dist/interactions/slashCommands/options/attachment.d.ts +7 -0
  144. package/dist/interactions/slashCommands/options/attachment.d.ts.map +1 -0
  145. package/dist/interactions/slashCommands/options/attachment.mjs +16 -0
  146. package/dist/interactions/slashCommands/options/attachment.mjs.map +1 -0
  147. package/dist/interactions/slashCommands/options/boolean.cjs +20 -0
  148. package/dist/interactions/slashCommands/options/boolean.cjs.map +1 -0
  149. package/dist/interactions/slashCommands/options/boolean.d.ts +7 -0
  150. package/dist/interactions/slashCommands/options/boolean.d.ts.map +1 -0
  151. package/dist/interactions/slashCommands/options/boolean.mjs +16 -0
  152. package/dist/interactions/slashCommands/options/boolean.mjs.map +1 -0
  153. package/dist/interactions/slashCommands/options/channel.cjs +34 -0
  154. package/dist/interactions/slashCommands/options/channel.cjs.map +1 -0
  155. package/dist/interactions/slashCommands/options/channel.d.ts +10 -0
  156. package/dist/interactions/slashCommands/options/channel.d.ts.map +1 -0
  157. package/dist/interactions/slashCommands/options/channel.mjs +32 -0
  158. package/dist/interactions/slashCommands/options/channel.mjs.map +1 -0
  159. package/dist/interactions/slashCommands/options/integer.cjs +50 -0
  160. package/dist/interactions/slashCommands/options/integer.cjs.map +1 -0
  161. package/dist/interactions/slashCommands/options/integer.d.ts +13 -0
  162. package/dist/interactions/slashCommands/options/integer.d.ts.map +1 -0
  163. package/dist/interactions/slashCommands/options/integer.mjs +48 -0
  164. package/dist/interactions/slashCommands/options/integer.mjs.map +1 -0
  165. package/dist/interactions/slashCommands/options/mentionable.cjs +20 -0
  166. package/dist/interactions/slashCommands/options/mentionable.cjs.map +1 -0
  167. package/dist/interactions/slashCommands/options/mentionable.d.ts +7 -0
  168. package/dist/interactions/slashCommands/options/mentionable.d.ts.map +1 -0
  169. package/dist/interactions/slashCommands/options/mentionable.mjs +16 -0
  170. package/dist/interactions/slashCommands/options/mentionable.mjs.map +1 -0
  171. package/dist/interactions/slashCommands/options/number.cjs +50 -0
  172. package/dist/interactions/slashCommands/options/number.cjs.map +1 -0
  173. package/dist/interactions/slashCommands/options/number.d.ts +13 -0
  174. package/dist/interactions/slashCommands/options/number.d.ts.map +1 -0
  175. package/dist/interactions/slashCommands/options/number.mjs +48 -0
  176. package/dist/interactions/slashCommands/options/number.mjs.map +1 -0
  177. package/dist/interactions/slashCommands/options/role.cjs +20 -0
  178. package/dist/interactions/slashCommands/options/role.cjs.map +1 -0
  179. package/dist/interactions/slashCommands/options/role.d.ts +7 -0
  180. package/dist/interactions/slashCommands/options/role.d.ts.map +1 -0
  181. package/dist/interactions/slashCommands/options/role.mjs +16 -0
  182. package/dist/interactions/slashCommands/options/role.mjs.map +1 -0
  183. package/dist/interactions/slashCommands/options/string.cjs +50 -0
  184. package/dist/interactions/slashCommands/options/string.cjs.map +1 -0
  185. package/dist/interactions/slashCommands/options/string.d.ts +24 -0
  186. package/dist/interactions/slashCommands/options/string.d.ts.map +1 -0
  187. package/dist/interactions/slashCommands/options/string.mjs +48 -0
  188. package/dist/interactions/slashCommands/options/string.mjs.map +1 -0
  189. package/dist/interactions/slashCommands/options/user.cjs +20 -0
  190. package/dist/interactions/slashCommands/options/user.cjs.map +1 -0
  191. package/dist/interactions/slashCommands/options/user.d.ts +7 -0
  192. package/dist/interactions/slashCommands/options/user.d.ts.map +1 -0
  193. package/dist/interactions/slashCommands/options/user.mjs +16 -0
  194. package/dist/interactions/slashCommands/options/user.mjs.map +1 -0
  195. package/dist/messages/embed/Assertions.cjs +62 -0
  196. package/dist/messages/embed/Assertions.cjs.map +1 -0
  197. package/dist/messages/embed/Assertions.d.ts +50 -0
  198. package/dist/messages/embed/Assertions.d.ts.map +1 -0
  199. package/dist/messages/embed/Assertions.mjs +41 -0
  200. package/dist/messages/embed/Assertions.mjs.map +1 -0
  201. package/dist/messages/embed/Embed.cjs +101 -0
  202. package/dist/messages/embed/Embed.cjs.map +1 -0
  203. package/dist/messages/embed/Embed.d.ts +108 -0
  204. package/dist/messages/embed/Embed.d.ts.map +1 -0
  205. package/dist/messages/embed/Embed.mjs +97 -0
  206. package/dist/messages/embed/Embed.mjs.map +1 -0
  207. package/dist/messages/formatters.cjs +102 -0
  208. package/dist/messages/formatters.cjs.map +1 -0
  209. package/dist/messages/formatters.d.ts +246 -0
  210. package/dist/messages/formatters.d.ts.map +1 -0
  211. package/dist/messages/formatters.mjs +79 -0
  212. package/dist/messages/formatters.mjs.map +1 -0
  213. package/dist/util/componentUtil.cjs +10 -0
  214. package/dist/util/componentUtil.cjs.map +1 -0
  215. package/dist/util/componentUtil.d.ts +3 -0
  216. package/dist/util/componentUtil.d.ts.map +1 -0
  217. package/dist/util/componentUtil.mjs +6 -0
  218. package/dist/util/componentUtil.mjs.map +1 -0
  219. package/dist/util/equatable.cjs +10 -0
  220. package/dist/util/equatable.cjs.map +1 -0
  221. package/dist/util/equatable.d.ts +12 -0
  222. package/dist/util/equatable.d.ts.map +1 -0
  223. package/dist/util/equatable.mjs +6 -0
  224. package/dist/util/equatable.mjs.map +1 -0
  225. package/dist/util/jsonEncodable.cjs +10 -0
  226. package/dist/util/jsonEncodable.cjs.map +1 -0
  227. package/dist/util/jsonEncodable.d.ts +12 -0
  228. package/dist/util/jsonEncodable.d.ts.map +1 -0
  229. package/dist/util/jsonEncodable.mjs +6 -0
  230. package/dist/util/jsonEncodable.mjs.map +1 -0
  231. package/dist/util/normalizeArray.cjs +12 -0
  232. package/dist/util/normalizeArray.cjs.map +1 -0
  233. package/dist/util/normalizeArray.d.ts +3 -0
  234. package/dist/util/normalizeArray.d.ts.map +1 -0
  235. package/dist/util/normalizeArray.mjs +8 -0
  236. package/dist/util/normalizeArray.mjs.map +1 -0
  237. package/dist/util/validation.cjs +13 -0
  238. package/dist/util/validation.cjs.map +1 -0
  239. package/dist/util/validation.d.ts +4 -0
  240. package/dist/util/validation.d.ts.map +1 -0
  241. package/dist/util/validation.mjs +7 -0
  242. package/dist/util/validation.mjs.map +1 -0
  243. package/package.json +17 -16
  244. package/dist/index.js +0 -1557
  245. package/dist/index.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,1406 +1,40 @@
1
- import * as _sapphire_shapeshift from '@sapphire/shapeshift';
2
- import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, APIActionRowComponentTypes, APIActionRowComponent, APIBaseComponent, ComponentType, APIButtonComponent, APISelectMenuComponent, APITextInputComponent, TextInputStyle, APIMessageActionRowComponent, APIModalActionRowComponent, APIMessageComponent, APIModalComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, Permissions, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, Locale, ApplicationCommandType } from 'discord-api-types/v10';
3
- import { URL } from 'url';
4
- import { Snowflake } from 'discord-api-types/globals';
5
-
6
- declare const fieldNamePredicate: _sapphire_shapeshift.StringValidator<string>;
7
- declare const fieldValuePredicate: _sapphire_shapeshift.StringValidator<string>;
8
- declare const fieldInlinePredicate: _sapphire_shapeshift.UnionValidator<boolean | undefined>;
9
- declare const embedFieldPredicate: _sapphire_shapeshift.ObjectValidator<{
10
- name: string;
11
- value: string;
12
- inline: boolean | undefined;
13
- }, _sapphire_shapeshift.UndefinedToOptional<{
14
- name: string;
15
- value: string;
16
- inline: boolean | undefined;
17
- }>>;
18
- declare const embedFieldsArrayPredicate: _sapphire_shapeshift.ArrayValidator<_sapphire_shapeshift.UndefinedToOptional<{
19
- name: string;
20
- value: string;
21
- inline: boolean | undefined;
22
- }>[], _sapphire_shapeshift.UndefinedToOptional<{
23
- name: string;
24
- value: string;
25
- inline: boolean | undefined;
26
- }>>;
27
- declare const fieldLengthPredicate: _sapphire_shapeshift.NumberValidator<number>;
28
- declare function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void;
29
- declare const authorNamePredicate: _sapphire_shapeshift.UnionValidator<string | null>;
30
- declare const imageURLPredicate: _sapphire_shapeshift.UnionValidator<string | null | undefined>;
31
- declare const urlPredicate: _sapphire_shapeshift.UnionValidator<string | null | undefined>;
32
- declare const embedAuthorPredicate: _sapphire_shapeshift.ObjectValidator<{
33
- name: string | null;
34
- iconURL: string | null | undefined;
35
- url: string | null | undefined;
36
- }, _sapphire_shapeshift.UndefinedToOptional<{
37
- name: string | null;
38
- iconURL: string | null | undefined;
39
- url: string | null | undefined;
40
- }>>;
41
- declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>;
42
- declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>;
43
- declare const descriptionPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
44
- declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
45
- declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
46
- text: string | null;
47
- iconURL: string | null | undefined;
48
- }, _sapphire_shapeshift.UndefinedToOptional<{
49
- text: string | null;
50
- iconURL: string | null | undefined;
51
- }>>;
52
- declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>;
53
- declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>;
54
-
55
- declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate;
56
- declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate;
57
- declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate;
58
- declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate;
59
- declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
60
- declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate;
61
- declare const Assertions$5_validateFieldLength: typeof validateFieldLength;
62
- declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate;
63
- declare const Assertions$5_imageURLPredicate: typeof imageURLPredicate;
64
- declare const Assertions$5_urlPredicate: typeof urlPredicate;
65
- declare const Assertions$5_embedAuthorPredicate: typeof embedAuthorPredicate;
66
- declare const Assertions$5_RGBPredicate: typeof RGBPredicate;
67
- declare const Assertions$5_colorPredicate: typeof colorPredicate;
68
- declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate;
69
- declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate;
70
- declare const Assertions$5_embedFooterPredicate: typeof embedFooterPredicate;
71
- declare const Assertions$5_timestampPredicate: typeof timestampPredicate;
72
- declare const Assertions$5_titlePredicate: typeof titlePredicate;
73
- declare namespace Assertions$5 {
74
- export {
75
- Assertions$5_fieldNamePredicate as fieldNamePredicate,
76
- Assertions$5_fieldValuePredicate as fieldValuePredicate,
77
- Assertions$5_fieldInlinePredicate as fieldInlinePredicate,
78
- Assertions$5_embedFieldPredicate as embedFieldPredicate,
79
- Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
80
- Assertions$5_fieldLengthPredicate as fieldLengthPredicate,
81
- Assertions$5_validateFieldLength as validateFieldLength,
82
- Assertions$5_authorNamePredicate as authorNamePredicate,
83
- Assertions$5_imageURLPredicate as imageURLPredicate,
84
- Assertions$5_urlPredicate as urlPredicate,
85
- Assertions$5_embedAuthorPredicate as embedAuthorPredicate,
86
- Assertions$5_RGBPredicate as RGBPredicate,
87
- Assertions$5_colorPredicate as colorPredicate,
88
- Assertions$5_descriptionPredicate as descriptionPredicate,
89
- Assertions$5_footerTextPredicate as footerTextPredicate,
90
- Assertions$5_embedFooterPredicate as embedFooterPredicate,
91
- Assertions$5_timestampPredicate as timestampPredicate,
92
- Assertions$5_titlePredicate as titlePredicate,
93
- };
94
- }
95
-
96
- declare function normalizeArray<T>(arr: RestOrArray<T>): T[];
97
- declare type RestOrArray<T> = T[] | [T[]];
98
-
99
- declare type RGBTuple = [red: number, green: number, blue: number];
100
- interface IconData {
101
- /**
102
- * The URL of the icon
103
- */
104
- iconURL?: string;
105
- /**
106
- * The proxy URL of the icon
107
- */
108
- proxyIconURL?: string;
109
- }
110
- declare type EmbedAuthorData = Omit<APIEmbedAuthor, 'icon_url' | 'proxy_icon_url'> & IconData;
111
- declare type EmbedAuthorOptions = Omit<EmbedAuthorData, 'proxyIconURL'>;
112
- declare type EmbedFooterData = Omit<APIEmbedFooter, 'icon_url' | 'proxy_icon_url'> & IconData;
113
- declare type EmbedFooterOptions = Omit<EmbedFooterData, 'proxyIconURL'>;
114
- interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {
115
- /**
116
- * The proxy URL for the image
117
- */
118
- proxyURL?: string;
119
- }
120
- /**
121
- * Represents a embed in a message (image/video preview, rich embed, etc.)
122
- */
123
- declare class EmbedBuilder {
124
- readonly data: APIEmbed;
125
- constructor(data?: APIEmbed);
126
- /**
127
- * Adds fields to the embed (max 25)
128
- *
129
- * @param fields The fields to add
130
- */
131
- addFields(...fields: RestOrArray<APIEmbedField>): this;
132
- /**
133
- * Removes, replaces, or inserts fields in the embed (max 25)
134
- *
135
- * @param index The index to start at
136
- * @param deleteCount The number of fields to remove
137
- * @param fields The replacing field objects
138
- */
139
- spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
140
- /**
141
- * Sets the embed's fields (max 25).
142
- * @param fields The fields to set
143
- */
144
- setFields(...fields: RestOrArray<APIEmbedField>): this;
145
- /**
146
- * Sets the author of this embed
147
- *
148
- * @param options The options for the author
149
- */
150
- setAuthor(options: EmbedAuthorOptions | null): this;
151
- /**
152
- * Sets the color of this embed
153
- *
154
- * @param color The color of the embed
155
- */
156
- setColor(color: number | RGBTuple | null): this;
157
- /**
158
- * Sets the description of this embed
159
- *
160
- * @param description The description
161
- */
162
- setDescription(description: string | null): this;
163
- /**
164
- * Sets the footer of this embed
165
- *
166
- * @param options The options for the footer
167
- */
168
- setFooter(options: EmbedFooterOptions | null): this;
169
- /**
170
- * Sets the image of this embed
171
- *
172
- * @param url The URL of the image
173
- */
174
- setImage(url: string | null): this;
175
- /**
176
- * Sets the thumbnail of this embed
177
- *
178
- * @param url The URL of the thumbnail
179
- */
180
- setThumbnail(url: string | null): this;
181
- /**
182
- * Sets the timestamp of this embed
183
- *
184
- * @param timestamp The timestamp or date
185
- */
186
- setTimestamp(timestamp?: number | Date | null): this;
187
- /**
188
- * Sets the title of this embed
189
- *
190
- * @param title The title
191
- */
192
- setTitle(title: string | null): this;
193
- /**
194
- * Sets the URL of this embed
195
- *
196
- * @param url The URL
197
- */
198
- setURL(url: string | null): this;
199
- /**
200
- * Transforms the embed to a plain object
201
- */
202
- toJSON(): APIEmbed;
203
- }
204
-
205
- /**
206
- * Wraps the content inside a codeblock with no language
207
- *
208
- * @param content - The content to wrap
209
- */
210
- declare function codeBlock<C extends string>(content: C): `\`\`\`\n${C}\`\`\``;
211
- /**
212
- * Wraps the content inside a codeblock with the specified language
213
- *
214
- * @param language - The language for the codeblock
215
- * @param content - The content to wrap
216
- */
217
- declare function codeBlock<L extends string, C extends string>(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``;
218
- /**
219
- * Wraps the content inside \`backticks\`, which formats it as inline code
220
- *
221
- * @param content - The content to wrap
222
- */
223
- declare function inlineCode<C extends string>(content: C): `\`${C}\``;
224
- /**
225
- * Formats the content into italic text
226
- *
227
- * @param content - The content to wrap
228
- */
229
- declare function italic<C extends string>(content: C): `_${C}_`;
230
- /**
231
- * Formats the content into bold text
232
- *
233
- * @param content - The content to wrap
234
- */
235
- declare function bold<C extends string>(content: C): `**${C}**`;
236
- /**
237
- * Formats the content into underscored text
238
- *
239
- * @param content - The content to wrap
240
- */
241
- declare function underscore<C extends string>(content: C): `__${C}__`;
242
- /**
243
- * Formats the content into strike-through text
244
- *
245
- * @param content - The content to wrap
246
- */
247
- declare function strikethrough<C extends string>(content: C): `~~${C}~~`;
248
- /**
249
- * Formats the content into a quote. This needs to be at the start of the line for Discord to format it
250
- *
251
- * @param content - The content to wrap
252
- */
253
- declare function quote<C extends string>(content: C): `> ${C}`;
254
- /**
255
- * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it
256
- *
257
- * @param content - The content to wrap
258
- */
259
- declare function blockQuote<C extends string>(content: C): `>>> ${C}`;
260
- /**
261
- * Wraps the URL into `<>`, which stops it from embedding
262
- *
263
- * @param url - The URL to wrap
264
- */
265
- declare function hideLinkEmbed<C extends string>(url: C): `<${C}>`;
266
- /**
267
- * Wraps the URL into `<>`, which stops it from embedding
268
- *
269
- * @param url - The URL to wrap
270
- */
271
- declare function hideLinkEmbed(url: URL): `<${string}>`;
272
- /**
273
- * Formats the content and the URL into a masked URL
274
- *
275
- * @param content - The content to display
276
- * @param url - The URL the content links to
277
- */
278
- declare function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;
279
- /**
280
- * Formats the content and the URL into a masked URL
281
- *
282
- * @param content - The content to display
283
- * @param url - The URL the content links to
284
- */
285
- declare function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;
286
- /**
287
- * Formats the content and the URL into a masked URL
288
- *
289
- * @param content - The content to display
290
- * @param url - The URL the content links to
291
- * @param title - The title shown when hovering on the masked link
292
- */
293
- declare function hyperlink<C extends string, T extends string>(content: C, url: URL, title: T): `[${C}](${string} "${T}")`;
294
- /**
295
- * Formats the content and the URL into a masked URL
296
- *
297
- * @param content - The content to display
298
- * @param url - The URL the content links to
299
- * @param title - The title shown when hovering on the masked link
300
- */
301
- declare function hyperlink<C extends string, U extends string, T extends string>(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
302
- /**
303
- * Wraps the content inside spoiler (hidden text)
304
- *
305
- * @param content - The content to wrap
306
- */
307
- declare function spoiler<C extends string>(content: C): `||${C}||`;
308
- /**
309
- * Formats a user ID into a user mention
310
- *
311
- * @param userId - The user ID to format
312
- */
313
- declare function userMention<C extends Snowflake>(userId: C): `<@${C}>`;
314
- /**
315
- * Formats a channel ID into a channel mention
316
- *
317
- * @param channelId - The channel ID to format
318
- */
319
- declare function channelMention<C extends Snowflake>(channelId: C): `<#${C}>`;
320
- /**
321
- * Formats a role ID into a role mention
322
- *
323
- * @param roleId - The role ID to format
324
- */
325
- declare function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>`;
326
- /**
327
- * Formats an emoji ID into a fully qualified emoji identifier
328
- *
329
- * @param emojiId - The emoji ID to format
330
- */
331
- declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;
332
- /**
333
- * Formats an emoji ID into a fully qualified emoji identifier
334
- *
335
- * @param emojiId - The emoji ID to format
336
- * @param animated - Whether the emoji is animated or not. Defaults to `false`
337
- */
338
- declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;
339
- /**
340
- * Formats a date into a short date-time string
341
- *
342
- * @param date - The date to format, defaults to the current time
343
- */
344
- declare function time(date?: Date): `<t:${bigint}>`;
345
- /**
346
- * Formats a date given a format style
347
- *
348
- * @param date - The date to format
349
- * @param style - The style to use
350
- */
351
- declare function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;
352
- /**
353
- * Formats the given timestamp into a short date-time string
354
- *
355
- * @param seconds - The time to format, represents an UNIX timestamp in seconds
356
- */
357
- declare function time<C extends number>(seconds: C): `<t:${C}>`;
358
- /**
359
- * Formats the given timestamp into a short date-time string
360
- *
361
- * @param seconds - The time to format, represents an UNIX timestamp in seconds
362
- * @param style - The style to use
363
- */
364
- declare function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;
365
- /**
366
- * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord
367
- */
368
- declare const TimestampStyles: {
369
- /**
370
- * Short time format, consisting of hours and minutes, e.g. 16:20
371
- */
372
- readonly ShortTime: "t";
373
- /**
374
- * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30
375
- */
376
- readonly LongTime: "T";
377
- /**
378
- * Short date format, consisting of day, month, and year, e.g. 20/04/2021
379
- */
380
- readonly ShortDate: "d";
381
- /**
382
- * Long date format, consisting of day, month, and year, e.g. 20 April 2021
383
- */
384
- readonly LongDate: "D";
385
- /**
386
- * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20
387
- */
388
- readonly ShortDateTime: "f";
389
- /**
390
- * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20
391
- */
392
- readonly LongDateTime: "F";
393
- /**
394
- * Relative time format, consisting of a relative duration format, e.g. 2 months ago
395
- */
396
- readonly RelativeTime: "R";
397
- };
398
- /**
399
- * The possible values, see {@link TimestampStyles} for more information
400
- */
401
- declare type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];
402
- /**
403
- * An enum with all the available faces from Discord's native slash commands
404
- */
405
- declare enum Faces {
406
- /**
407
- * ¯\\_(ツ)\\_/¯
408
- */
409
- Shrug = "\u00AF\\_(\u30C4)\\_/\u00AF",
410
- /**
411
- * (╯°□°)╯︵ ┻━┻
412
- */
413
- Tableflip = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B",
414
- /**
415
- * ┬─┬ ノ( ゜-゜ノ)
416
- */
417
- Unflip = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)"
418
- }
419
-
420
- /**
421
- * Represents a option within a select menu component
422
- */
423
- declare class SelectMenuOptionBuilder {
424
- data: Partial<APISelectMenuOption>;
425
- constructor(data?: Partial<APISelectMenuOption>);
426
- /**
427
- * Sets the label of this option
428
- *
429
- * @param label - The label to show on this option
430
- */
431
- setLabel(label: string): this;
432
- /**
433
- * Sets the value of this option
434
- *
435
- * @param value - The value of this option
436
- */
437
- setValue(value: string): this;
438
- /**
439
- * Sets the description of this option
440
- *
441
- * @param description - The description of this option
442
- */
443
- setDescription(description: string): this;
444
- /**
445
- * Sets whether this option is selected by default
446
- *
447
- * @param isDefault - Whether this option is selected by default
448
- */
449
- setDefault(isDefault?: boolean): this;
450
- /**
451
- * Sets the emoji to display on this option
452
- *
453
- * @param emoji - The emoji to display on this option
454
- */
455
- setEmoji(emoji: APIMessageComponentEmoji): this;
456
- toJSON(): APISelectMenuOption;
457
- }
458
-
459
- declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>;
460
- declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{
461
- id?: string | undefined;
462
- name?: string | undefined;
463
- animated?: boolean | undefined;
464
- }, _sapphire_shapeshift.UndefinedToOptional<{
465
- id?: string | undefined;
466
- name?: string | undefined;
467
- animated?: boolean | undefined;
468
- }>>;
469
- declare const disabledValidator: _sapphire_shapeshift.BooleanValidator<boolean>;
470
- declare const buttonLabelValidator: _sapphire_shapeshift.StringValidator<string>;
471
- declare const buttonStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof ButtonStyle>;
472
- declare const placeholderValidator$1: _sapphire_shapeshift.StringValidator<string>;
473
- declare const minMaxValidator: _sapphire_shapeshift.NumberValidator<number>;
474
- declare const labelValueDescriptionValidator: _sapphire_shapeshift.StringValidator<string>;
475
- declare const optionValidator: _sapphire_shapeshift.UnionValidator<SelectMenuOptionBuilder | _sapphire_shapeshift.UndefinedToOptional<{
476
- label: string;
477
- value: string;
478
- description: string | undefined;
479
- emoji: _sapphire_shapeshift.UndefinedToOptional<{
480
- id?: string | undefined;
481
- name?: string | undefined;
482
- animated?: boolean | undefined;
483
- }> | undefined;
484
- default: boolean | undefined;
485
- }>>;
486
- declare const optionsValidator: _sapphire_shapeshift.ArrayValidator<(SelectMenuOptionBuilder | _sapphire_shapeshift.UndefinedToOptional<{
487
- label: string;
488
- value: string;
489
- description: string | undefined;
490
- emoji: _sapphire_shapeshift.UndefinedToOptional<{
491
- id?: string | undefined;
492
- name?: string | undefined;
493
- animated?: boolean | undefined;
494
- }> | undefined;
495
- default: boolean | undefined;
496
- }>)[], SelectMenuOptionBuilder | _sapphire_shapeshift.UndefinedToOptional<{
497
- label: string;
498
- value: string;
499
- description: string | undefined;
500
- emoji: _sapphire_shapeshift.UndefinedToOptional<{
501
- id?: string | undefined;
502
- name?: string | undefined;
503
- animated?: boolean | undefined;
504
- }> | undefined;
505
- default: boolean | undefined;
506
- }>>;
507
- declare const optionsLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
508
- declare function validateRequiredSelectMenuParameters(options: SelectMenuOptionBuilder[], customId?: string): void;
509
- declare const defaultValidator: _sapphire_shapeshift.BooleanValidator<boolean>;
510
- declare function validateRequiredSelectMenuOptionParameters(label?: string, value?: string): void;
511
- declare const urlValidator: _sapphire_shapeshift.StringValidator<string>;
512
- declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, url?: string): void;
513
-
514
- declare const Assertions$4_customIdValidator: typeof customIdValidator;
515
- declare const Assertions$4_emojiValidator: typeof emojiValidator;
516
- declare const Assertions$4_disabledValidator: typeof disabledValidator;
517
- declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator;
518
- declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator;
519
- declare const Assertions$4_minMaxValidator: typeof minMaxValidator;
520
- declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
521
- declare const Assertions$4_optionValidator: typeof optionValidator;
522
- declare const Assertions$4_optionsValidator: typeof optionsValidator;
523
- declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator;
524
- declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
525
- declare const Assertions$4_defaultValidator: typeof defaultValidator;
526
- declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
527
- declare const Assertions$4_urlValidator: typeof urlValidator;
528
- declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
529
- declare namespace Assertions$4 {
530
- export {
531
- Assertions$4_customIdValidator as customIdValidator,
532
- Assertions$4_emojiValidator as emojiValidator,
533
- Assertions$4_disabledValidator as disabledValidator,
534
- Assertions$4_buttonLabelValidator as buttonLabelValidator,
535
- Assertions$4_buttonStyleValidator as buttonStyleValidator,
536
- placeholderValidator$1 as placeholderValidator,
537
- Assertions$4_minMaxValidator as minMaxValidator,
538
- Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator,
539
- Assertions$4_optionValidator as optionValidator,
540
- Assertions$4_optionsValidator as optionsValidator,
541
- Assertions$4_optionsLengthValidator as optionsLengthValidator,
542
- Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters,
543
- Assertions$4_defaultValidator as defaultValidator,
544
- Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters,
545
- Assertions$4_urlValidator as urlValidator,
546
- Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters,
547
- };
548
- }
549
-
550
- interface JSONEncodable<T> {
551
- /**
552
- * Transforms this object to its JSON format
553
- */
554
- toJSON: () => T;
555
- }
556
- /**
557
- * Indicates if an object is encodable or not.
558
- * @param maybeEncodable - The object to check against
559
- */
560
- declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown>;
561
-
562
- declare type AnyAPIActionRowComponent = APIActionRowComponentTypes | APIActionRowComponent<APIActionRowComponentTypes>;
563
- /**
564
- * Represents a discord component
565
- */
566
- declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>> implements JSONEncodable<AnyAPIActionRowComponent> {
567
- /**
568
- * The API data associated with this component
569
- */
570
- readonly data: Partial<DataType>;
571
- abstract toJSON(): AnyAPIActionRowComponent;
572
- constructor(data: Partial<DataType>);
573
- }
574
-
575
- /**
576
- * Represents a button component
577
- */
578
- declare class ButtonBuilder extends ComponentBuilder<APIButtonComponent> {
579
- constructor(data?: Partial<APIButtonComponent>);
580
- /**
581
- * Sets the style of this button
582
- *
583
- * @param style - The style of the button
584
- */
585
- setStyle(style: ButtonStyle): this;
586
- /**
587
- * Sets the URL for this button
588
- *
589
- * @param url - The URL to open when this button is clicked
590
- */
591
- setURL(url: string): this;
592
- /**
593
- * Sets the custom id for this button
594
- *
595
- * @param customId - The custom id to use for this button
596
- */
597
- setCustomId(customId: string): this;
598
- /**
599
- * Sets the emoji to display on this button
600
- *
601
- * @param emoji - The emoji to display on this button
602
- */
603
- setEmoji(emoji: APIMessageComponentEmoji): this;
604
- /**
605
- * Sets whether this button is disabled
606
- *
607
- * @param disabled - Whether to disable this button
608
- */
609
- setDisabled(disabled?: boolean): this;
610
- /**
611
- * Sets the label for this button
612
- *
613
- * @param label - The label to display on this button
614
- */
615
- setLabel(label: string): this;
616
- toJSON(): APIButtonComponent;
617
- }
618
-
619
- /**
620
- * Represents a select menu component
621
- */
622
- declare class SelectMenuBuilder extends ComponentBuilder<APISelectMenuComponent> {
623
- /**
624
- * The options within this select menu
625
- */
626
- readonly options: SelectMenuOptionBuilder[];
627
- constructor(data?: Partial<APISelectMenuComponent>);
628
- /**
629
- * Sets the placeholder for this select menu
630
- *
631
- * @param placeholder - The placeholder to use for this select menu
632
- */
633
- setPlaceholder(placeholder: string): this;
634
- /**
635
- * Sets the minimum values that must be selected in the select menu
636
- *
637
- * @param minValues - The minimum values that must be selected
638
- */
639
- setMinValues(minValues: number): this;
640
- /**
641
- * Sets the maximum values that must be selected in the select menu
642
- *
643
- * @param maxValues - The maximum values that must be selected
644
- */
645
- setMaxValues(maxValues: number): this;
646
- /**
647
- * Sets the custom id for this select menu
648
- *
649
- * @param customId - The custom id to use for this select menu
650
- */
651
- setCustomId(customId: string): this;
652
- /**
653
- * Sets whether this select menu is disabled
654
- *
655
- * @param disabled - Whether this select menu is disabled
656
- */
657
- setDisabled(disabled?: boolean): this;
658
- /**
659
- * Adds options to this select menu
660
- *
661
- * @param options - The options to add to this select menu
662
- * @returns
663
- */
664
- addOptions(...options: RestOrArray<SelectMenuOptionBuilder | APISelectMenuOption>): this;
665
- /**
666
- * Sets the options on this select menu
667
- *
668
- * @param options - The options to set on this select menu
669
- */
670
- setOptions(...options: RestOrArray<SelectMenuOptionBuilder | APISelectMenuOption>): this;
671
- toJSON(): APISelectMenuComponent;
672
- }
673
-
674
- declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> {
675
- constructor(data?: APITextInputComponent & {
676
- type?: ComponentType.TextInput;
677
- });
678
- /**
679
- * Sets the custom id for this text input
680
- *
681
- * @param customId - The custom id of this text input
682
- */
683
- setCustomId(customId: string): this;
684
- /**
685
- * Sets the label for this text input
686
- *
687
- * @param label - The label for this text input
688
- */
689
- setLabel(label: string): this;
690
- /**
691
- * Sets the style for this text input
692
- *
693
- * @param style - The style for this text input
694
- */
695
- setStyle(style: TextInputStyle): this;
696
- /**
697
- * Sets the minimum length of text for this text input
698
- *
699
- * @param minLength - The minimum length of text for this text input
700
- */
701
- setMinLength(minLength: number): this;
702
- /**
703
- * Sets the maximum length of text for this text input
704
- *
705
- * @param maxLength - The maximum length of text for this text input
706
- */
707
- setMaxLength(maxLength: number): this;
708
- /**
709
- * Sets the placeholder of this text input
710
- *
711
- * @param placeholder - The placeholder of this text input
712
- */
713
- setPlaceholder(placeholder: string): this;
714
- /**
715
- * Sets the value of this text input
716
- *
717
- * @param value - The value for this text input
718
- */
719
- setValue(value: string): this;
720
- /**
721
- * Sets whether this text input is required
722
- *
723
- * @param required - Whether this text input is required
724
- */
725
- setRequired(required?: boolean): this;
726
- toJSON(): APITextInputComponent;
727
- equals(other: JSONEncodable<APITextInputComponent> | APITextInputComponent): boolean;
728
- }
729
-
730
- declare type MessageComponentBuilder = MessageActionRowComponentBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
731
- declare type ModalComponentBuilder = ModalActionRowComponentBuilder | ActionRowBuilder<ModalActionRowComponentBuilder>;
732
- declare type MessageActionRowComponentBuilder = ButtonBuilder | SelectMenuBuilder;
733
- declare type ModalActionRowComponentBuilder = TextInputBuilder;
734
- declare type AnyComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComponentBuilder;
735
- /**
736
- * Represents an action row component
737
- */
738
- declare class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> {
739
- /**
740
- * The components within this action row
741
- */
742
- readonly components: T[];
743
- constructor({ components, ...data }?: Partial<APIActionRowComponent<APIActionRowComponentTypes>>);
744
- /**
745
- * Adds components to this action row.
746
- *
747
- * @param components - The components to add to this action row.
748
- */
749
- addComponents(...components: RestOrArray<T>): this;
750
- /**
751
- * Sets the components in this action row
752
- *
753
- * @param components - The components to set this row to
754
- */
755
- setComponents(...components: RestOrArray<T>): this;
756
- toJSON(): APIActionRowComponent<ReturnType<T['toJSON']>>;
757
- }
758
-
759
- interface MappedComponentTypes {
760
- [ComponentType.ActionRow]: ActionRowBuilder<AnyComponentBuilder>;
761
- [ComponentType.Button]: ButtonBuilder;
762
- [ComponentType.SelectMenu]: SelectMenuBuilder;
763
- [ComponentType.TextInput]: TextInputBuilder;
764
- }
765
- /**
766
- * Factory for creating components from API data
767
- *
768
- * @param data - The api data to transform to a component class
769
- */
770
- declare function createComponentBuilder<T extends keyof MappedComponentTypes>(data: (APIMessageComponent | APIModalComponent) & {
771
- type: T;
772
- }): MappedComponentTypes[T];
773
- declare function createComponentBuilder<C extends MessageComponentBuilder | ModalComponentBuilder>(data: C): C;
774
-
775
- declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>;
776
- declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
777
- declare const maxLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
778
- declare const requiredValidator: _sapphire_shapeshift.BooleanValidator<boolean>;
779
- declare const valueValidator: _sapphire_shapeshift.StringValidator<string>;
780
- declare const placeholderValidator: _sapphire_shapeshift.StringValidator<string>;
781
- declare const labelValidator: _sapphire_shapeshift.StringValidator<string>;
782
- declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
783
-
784
- declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator;
785
- declare const Assertions$3_minLengthValidator: typeof minLengthValidator;
786
- declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator;
787
- declare const Assertions$3_requiredValidator: typeof requiredValidator;
788
- declare const Assertions$3_valueValidator: typeof valueValidator;
789
- declare const Assertions$3_placeholderValidator: typeof placeholderValidator;
790
- declare const Assertions$3_labelValidator: typeof labelValidator;
791
- declare namespace Assertions$3 {
792
- export {
793
- Assertions$3_textInputStyleValidator as textInputStyleValidator,
794
- Assertions$3_minLengthValidator as minLengthValidator,
795
- Assertions$3_maxLengthValidator as maxLengthValidator,
796
- Assertions$3_requiredValidator as requiredValidator,
797
- Assertions$3_valueValidator as valueValidator,
798
- Assertions$3_placeholderValidator as placeholderValidator,
799
- Assertions$3_labelValidator as labelValidator,
800
- validateRequiredParameters$3 as validateRequiredParameters,
801
- };
802
- }
803
-
804
- declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCallbackData> {
805
- readonly data: Partial<APIModalInteractionResponseCallbackData>;
806
- readonly components: ActionRowBuilder<ModalActionRowComponentBuilder>[];
807
- constructor({ components, ...data }?: Partial<APIModalInteractionResponseCallbackData>);
808
- /**
809
- * Sets the title of the modal
810
- *
811
- * @param title - The title of the modal
812
- */
813
- setTitle(title: string): this;
814
- /**
815
- * Sets the custom id of the modal
816
- *
817
- * @param customId - The custom id of this modal
818
- */
819
- setCustomId(customId: string): this;
820
- /**
821
- * Adds components to this modal
822
- *
823
- * @param components - The components to add to this modal
824
- */
825
- addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>): this;
826
- /**
827
- * Sets the components in this modal
828
- *
829
- * @param components - The components to set this modal to
830
- */
831
- setComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder>>): this;
832
- toJSON(): APIModalInteractionResponseCallbackData;
833
- }
834
-
835
- declare const titleValidator: _sapphire_shapeshift.StringValidator<string>;
836
- declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>;
837
- declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void;
838
-
839
- declare const Assertions$2_titleValidator: typeof titleValidator;
840
- declare const Assertions$2_componentsValidator: typeof componentsValidator;
841
- declare namespace Assertions$2 {
842
- export {
843
- Assertions$2_titleValidator as titleValidator,
844
- Assertions$2_componentsValidator as componentsValidator,
845
- validateRequiredParameters$2 as validateRequiredParameters,
846
- };
847
- }
848
-
849
- declare class SharedNameAndDescription {
850
- readonly name: string;
851
- readonly name_localizations?: LocalizationMap;
852
- readonly description: string;
853
- readonly description_localizations?: LocalizationMap;
854
- /**
855
- * Sets the name
856
- *
857
- * @param name - The name
858
- */
859
- setName(name: string): this;
860
- /**
861
- * Sets the description
862
- *
863
- * @param description - The description
864
- */
865
- setDescription(description: string): this;
866
- /**
867
- * Sets a name localization
868
- *
869
- * @param locale - The locale to set a description for
870
- * @param localizedName - The localized description for the given locale
871
- */
872
- setNameLocalization(locale: LocaleString, localizedName: string | null): this;
873
- /**
874
- * Sets the name localizations
875
- *
876
- * @param localizedNames - The dictionary of localized descriptions to set
877
- */
878
- setNameLocalizations(localizedNames: LocalizationMap | null): this;
879
- /**
880
- * Sets a description localization
881
- *
882
- * @param locale - The locale to set a description for
883
- * @param localizedDescription - The localized description for the given locale
884
- */
885
- setDescriptionLocalization(locale: LocaleString, localizedDescription: string | null): this;
886
- /**
887
- * Sets the description localizations
888
- *
889
- * @param localizedDescriptions - The dictionary of localized descriptions to set
890
- */
891
- setDescriptionLocalizations(localizedDescriptions: LocalizationMap | null): this;
892
- }
893
-
894
- declare abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {
895
- abstract readonly type: ApplicationCommandOptionType;
896
- readonly required: boolean;
897
- /**
898
- * Marks the option as required
899
- *
900
- * @param required - If this option should be required
901
- */
902
- setRequired(required: boolean): this;
903
- abstract toJSON(): APIApplicationCommandBasicOption;
904
- protected runRequiredValidations(): void;
905
- }
906
-
907
- declare class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {
908
- readonly type: ApplicationCommandOptionType.Attachment;
909
- toJSON(): APIApplicationCommandAttachmentOption;
910
- }
911
-
912
- declare class SlashCommandBooleanOption extends ApplicationCommandOptionBase {
913
- readonly type: ApplicationCommandOptionType.Boolean;
914
- toJSON(): APIApplicationCommandBooleanOption;
915
- }
916
-
917
- declare const allowedChannelTypes: readonly [ChannelType.GuildText, ChannelType.GuildVoice, ChannelType.GuildCategory, ChannelType.GuildNews, ChannelType.GuildNewsThread, ChannelType.GuildPublicThread, ChannelType.GuildPrivateThread, ChannelType.GuildStageVoice];
918
- declare type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];
919
- declare class ApplicationCommandOptionChannelTypesMixin {
920
- readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];
921
- /**
922
- * Adds channel types to this option
923
- *
924
- * @param channelTypes - The channel types to add
925
- */
926
- addChannelTypes(...channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
927
- }
928
-
929
- declare class SlashCommandChannelOption extends ApplicationCommandOptionBase {
930
- readonly type: ApplicationCommandOptionType.Channel;
931
- toJSON(): APIApplicationCommandChannelOption;
932
- }
933
- interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin {
934
- }
935
-
936
- declare abstract class ApplicationCommandNumericOptionMinMaxValueMixin {
937
- readonly max_value?: number;
938
- readonly min_value?: number;
939
- /**
940
- * Sets the maximum number value of this option
941
- *
942
- * @param max - The maximum value this option can be
943
- */
944
- abstract setMaxValue(max: number): this;
945
- /**
946
- * Sets the minimum number value of this option
947
- *
948
- * @param min - The minimum value this option can be
949
- */
950
- abstract setMinValue(min: number): this;
951
- }
952
-
953
- declare class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends string | number> {
954
- readonly choices?: APIApplicationCommandOptionChoice<T>[];
955
- readonly autocomplete?: boolean;
956
- readonly type: ApplicationCommandOptionType;
957
- /**
958
- * Adds multiple choices for this option
959
- *
960
- * @param choices - The choices to add
961
- */
962
- addChoices(...choices: APIApplicationCommandOptionChoice<T>[]): this;
963
- setChoices<Input extends APIApplicationCommandOptionChoice<T>[]>(...choices: Input): this;
964
- /**
965
- * Marks the option as autocompletable
966
- * @param autocomplete - If this option should be autocompletable
967
- */
968
- setAutocomplete(autocomplete: boolean): this;
969
- }
970
-
971
- declare class SlashCommandIntegerOption extends ApplicationCommandOptionBase implements ApplicationCommandNumericOptionMinMaxValueMixin {
972
- readonly type: ApplicationCommandOptionType.Integer;
973
- setMaxValue(max: number): this;
974
- setMinValue(min: number): this;
975
- toJSON(): APIApplicationCommandIntegerOption;
976
- }
977
- interface SlashCommandIntegerOption extends ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {
978
- }
979
-
980
- declare class SlashCommandMentionableOption extends ApplicationCommandOptionBase {
981
- readonly type: ApplicationCommandOptionType.Mentionable;
982
- toJSON(): APIApplicationCommandMentionableOption;
983
- }
984
-
985
- declare class SlashCommandNumberOption extends ApplicationCommandOptionBase implements ApplicationCommandNumericOptionMinMaxValueMixin {
986
- readonly type: ApplicationCommandOptionType.Number;
987
- setMaxValue(max: number): this;
988
- setMinValue(min: number): this;
989
- toJSON(): APIApplicationCommandNumberOption;
990
- }
991
- interface SlashCommandNumberOption extends ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {
992
- }
993
-
994
- declare class SlashCommandRoleOption extends ApplicationCommandOptionBase {
995
- readonly type: ApplicationCommandOptionType.Role;
996
- toJSON(): APIApplicationCommandRoleOption;
997
- }
998
-
999
- declare class SlashCommandStringOption extends ApplicationCommandOptionBase {
1000
- readonly type: ApplicationCommandOptionType.String;
1001
- readonly max_length?: number;
1002
- readonly min_length?: number;
1003
- /**
1004
- * Sets the maximum length of this string option.
1005
- *
1006
- * @param max - The maximum length this option can be
1007
- */
1008
- setMaxLength(max: number): this;
1009
- /**
1010
- * Sets the minimum length of this string option.
1011
- *
1012
- * @param min - The minimum length this option can be
1013
- */
1014
- setMinLength(min: number): this;
1015
- toJSON(): APIApplicationCommandStringOption;
1016
- }
1017
- interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {
1018
- }
1019
-
1020
- declare class SlashCommandUserOption extends ApplicationCommandOptionBase {
1021
- readonly type: ApplicationCommandOptionType.User;
1022
- toJSON(): APIApplicationCommandUserOption;
1023
- }
1024
-
1025
- declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
1026
- readonly options: ToAPIApplicationCommandOptions[];
1027
- /**
1028
- * Adds a boolean option
1029
- *
1030
- * @param input - A function that returns an option builder, or an already built builder
1031
- */
1032
- addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1033
- /**
1034
- * Adds a user option
1035
- *
1036
- * @param input - A function that returns an option builder, or an already built builder
1037
- */
1038
- addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1039
- /**
1040
- * Adds a channel option
1041
- *
1042
- * @param input - A function that returns an option builder, or an already built builder
1043
- */
1044
- addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1045
- /**
1046
- * Adds a role option
1047
- *
1048
- * @param input - A function that returns an option builder, or an already built builder
1049
- */
1050
- addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1051
- /**
1052
- * Adds an attachment option
1053
- *
1054
- * @param input - A function that returns an option builder, or an already built builder
1055
- */
1056
- addAttachmentOption(input: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1057
- /**
1058
- * Adds a mentionable option
1059
- *
1060
- * @param input - A function that returns an option builder, or an already built builder
1061
- */
1062
- addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1063
- /**
1064
- * Adds a string option
1065
- *
1066
- * @param input - A function that returns an option builder, or an already built builder
1067
- */
1068
- 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;
1069
- /**
1070
- * Adds an integer option
1071
- *
1072
- * @param input - A function that returns an option builder, or an already built builder
1073
- */
1074
- 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;
1075
- /**
1076
- * Adds a number option
1077
- *
1078
- * @param input - A function that returns an option builder, or an already built builder
1079
- */
1080
- 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;
1081
- private _sharedAddOptionMethod;
1082
- }
1083
-
1084
- /**
1085
- * Represents a folder for subcommands
1086
- *
1087
- * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
1088
- */
1089
- declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {
1090
- /**
1091
- * The name of this subcommand group
1092
- */
1093
- readonly name: string;
1094
- /**
1095
- * The description of this subcommand group
1096
- */
1097
- readonly description: string;
1098
- /**
1099
- * The subcommands part of this subcommand group
1100
- */
1101
- readonly options: SlashCommandSubcommandBuilder[];
1102
- /**
1103
- * Adds a new subcommand to this group
1104
- *
1105
- * @param input - A function that returns a subcommand builder, or an already built builder
1106
- */
1107
- addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this;
1108
- toJSON(): APIApplicationCommandSubcommandGroupOption;
1109
- }
1110
- interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {
1111
- }
1112
- /**
1113
- * Represents a subcommand
1114
- *
1115
- * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
1116
- */
1117
- declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {
1118
- /**
1119
- * The name of this subcommand
1120
- */
1121
- readonly name: string;
1122
- /**
1123
- * The description of this subcommand
1124
- */
1125
- readonly description: string;
1126
- /**
1127
- * The options of this subcommand
1128
- */
1129
- readonly options: ApplicationCommandOptionBase[];
1130
- toJSON(): APIApplicationCommandSubcommandOption;
1131
- }
1132
- interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {
1133
- }
1134
-
1135
- declare class SlashCommandBuilder {
1136
- /**
1137
- * The name of this slash command
1138
- */
1139
- readonly name: string;
1140
- /**
1141
- * The localized names for this command
1142
- */
1143
- readonly name_localizations?: LocalizationMap;
1144
- /**
1145
- * The description of this slash command
1146
- */
1147
- readonly description: string;
1148
- /**
1149
- * The localized descriptions for this command
1150
- */
1151
- readonly description_localizations?: LocalizationMap;
1152
- /**
1153
- * The options of this slash command
1154
- */
1155
- readonly options: ToAPIApplicationCommandOptions[];
1156
- /**
1157
- * Whether the command is enabled by default when the app is added to a guild
1158
- *
1159
- * @deprecated This property is deprecated and will be removed in the future.
1160
- * You should use `setDefaultMemberPermissions` or `setDMPermission` instead.
1161
- */
1162
- readonly default_permission: boolean | undefined;
1163
- /**
1164
- * Set of permissions represented as a bit set for the command
1165
- */
1166
- readonly default_member_permissions: Permissions | null | undefined;
1167
- /**
1168
- * Indicates whether the command is available in DMs with the application, only for globally-scoped commands.
1169
- * By default, commands are visible.
1170
- */
1171
- readonly dm_permission: boolean | undefined;
1172
- /**
1173
- * Returns the final data that should be sent to Discord.
1174
- *
1175
- * **Note:** Calling this function will validate required properties based on their conditions.
1176
- */
1177
- toJSON(): RESTPostAPIApplicationCommandsJSONBody;
1178
- /**
1179
- * Sets whether the command is enabled by default when the application is added to a guild.
1180
- *
1181
- * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
1182
- *
1183
- * @param value - Whether or not to enable this command by default
1184
- *
1185
- * @see https://discord.com/developers/docs/interactions/application-commands#permissions
1186
- * @deprecated Use `setDefaultMemberPermissions` or `setDMPermission` instead.
1187
- */
1188
- setDefaultPermission(value: boolean): this;
1189
- /**
1190
- * Sets the default permissions a member should have in order to run the command.
1191
- *
1192
- * **Note:** You can set this to `'0'` to disable the command by default.
1193
- *
1194
- * @param permissions - The permissions bit field to set
1195
- *
1196
- * @see https://discord.com/developers/docs/interactions/application-commands#permissions
1197
- */
1198
- setDefaultMemberPermissions(permissions: Permissions | bigint | number | null | undefined): this;
1199
- /**
1200
- * Sets if the command is available in DMs with the application, only for globally-scoped commands.
1201
- * By default, commands are visible.
1202
- *
1203
- * @param enabled - If the command should be enabled in DMs
1204
- *
1205
- * @see https://discord.com/developers/docs/interactions/application-commands#permissions
1206
- */
1207
- setDMPermission(enabled: boolean | null | undefined): this;
1208
- /**
1209
- * Adds a new subcommand group to this command
1210
- *
1211
- * @param input - A function that returns a subcommand group builder, or an already built builder
1212
- */
1213
- addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandsOnlyBuilder;
1214
- /**
1215
- * Adds a new subcommand to this command
1216
- *
1217
- * @param input - A function that returns a subcommand builder, or an already built builder
1218
- */
1219
- addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder;
1220
- }
1221
- interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {
1222
- }
1223
- interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, Pick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {
1224
- }
1225
- interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick<SlashCommandBuilder, 'toJSON'> {
1226
- }
1227
- interface ToAPIApplicationCommandOptions {
1228
- toJSON: () => APIApplicationCommandOption;
1229
- }
1230
-
1231
- declare function validateName$1(name: unknown): asserts name is string;
1232
- declare function validateDescription(description: unknown): asserts description is string;
1233
- declare function validateLocale(locale: unknown): Locale;
1234
- declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
1235
- declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
1236
- declare function validateDefaultPermission$1(value: unknown): asserts value is boolean;
1237
- declare function validateRequired(required: unknown): asserts required is boolean;
1238
- declare function validateChoicesLength(amountAdding: number, choices?: APIApplicationCommandOptionChoice[]): void;
1239
- declare function assertReturnOfBuilder<T extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
1240
- declare const localizationMapPredicate: _sapphire_shapeshift.UnionValidator<_sapphire_shapeshift.UndefinedToOptional<Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string | null>>> | null | undefined>;
1241
- declare function validateLocalizationMap(value: unknown): asserts value is LocalizationMap;
1242
- declare function validateDMPermission$1(value: unknown): asserts value is boolean | null | undefined;
1243
- declare function validateDefaultMemberPermissions$1(permissions: unknown): string | null | undefined;
1244
-
1245
- declare const Assertions$1_validateDescription: typeof validateDescription;
1246
- declare const Assertions$1_validateLocale: typeof validateLocale;
1247
- declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
1248
- declare const Assertions$1_validateRequired: typeof validateRequired;
1249
- declare const Assertions$1_validateChoicesLength: typeof validateChoicesLength;
1250
- declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;
1251
- declare const Assertions$1_localizationMapPredicate: typeof localizationMapPredicate;
1252
- declare const Assertions$1_validateLocalizationMap: typeof validateLocalizationMap;
1253
- declare namespace Assertions$1 {
1254
- export {
1255
- validateName$1 as validateName,
1256
- Assertions$1_validateDescription as validateDescription,
1257
- Assertions$1_validateLocale as validateLocale,
1258
- Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
1259
- validateRequiredParameters$1 as validateRequiredParameters,
1260
- validateDefaultPermission$1 as validateDefaultPermission,
1261
- Assertions$1_validateRequired as validateRequired,
1262
- Assertions$1_validateChoicesLength as validateChoicesLength,
1263
- Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,
1264
- Assertions$1_localizationMapPredicate as localizationMapPredicate,
1265
- Assertions$1_validateLocalizationMap as validateLocalizationMap,
1266
- validateDMPermission$1 as validateDMPermission,
1267
- validateDefaultMemberPermissions$1 as validateDefaultMemberPermissions,
1268
- };
1269
- }
1270
-
1271
- declare class ContextMenuCommandBuilder {
1272
- /**
1273
- * The name of this context menu command
1274
- */
1275
- readonly name: string;
1276
- /**
1277
- * The localized names for this command
1278
- */
1279
- readonly name_localizations?: LocalizationMap;
1280
- /**
1281
- * The type of this context menu command
1282
- */
1283
- readonly type: ContextMenuCommandType;
1284
- /**
1285
- * Whether the command is enabled by default when the app is added to a guild
1286
- *
1287
- * @deprecated This property is deprecated and will be removed in the future.
1288
- * You should use `setDefaultMemberPermissions` or `setDMPermission` instead.
1289
- */
1290
- readonly default_permission: boolean | undefined;
1291
- /**
1292
- * Set of permissions represented as a bit set for the command
1293
- */
1294
- readonly default_member_permissions: Permissions | null | undefined;
1295
- /**
1296
- * Indicates whether the command is available in DMs with the application, only for globally-scoped commands.
1297
- * By default, commands are visible.
1298
- */
1299
- readonly dm_permission: boolean | undefined;
1300
- /**
1301
- * Sets the name
1302
- *
1303
- * @param name - The name
1304
- */
1305
- setName(name: string): this;
1306
- /**
1307
- * Sets the type
1308
- *
1309
- * @param type - The type
1310
- */
1311
- setType(type: ContextMenuCommandType): this;
1312
- /**
1313
- * Sets whether the command is enabled by default when the application is added to a guild.
1314
- *
1315
- * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.
1316
- *
1317
- * @param value - Whether or not to enable this command by default
1318
- *
1319
- * @see https://discord.com/developers/docs/interactions/application-commands#permissions
1320
- * @deprecated Use `setDefaultMemberPermissions` or `setDMPermission` instead.
1321
- */
1322
- setDefaultPermission(value: boolean): this;
1323
- /**
1324
- * Sets the default permissions a member should have in order to run the command.
1325
- *
1326
- * **Note:** You can set this to `'0'` to disable the command by default.
1327
- *
1328
- * @param permissions - The permissions bit field to set
1329
- *
1330
- * @see https://discord.com/developers/docs/interactions/application-commands#permissions
1331
- */
1332
- setDefaultMemberPermissions(permissions: Permissions | bigint | number | null | undefined): this;
1333
- /**
1334
- * Sets if the command is available in DMs with the application, only for globally-scoped commands.
1335
- * By default, commands are visible.
1336
- *
1337
- * @param enabled - If the command should be enabled in DMs
1338
- *
1339
- * @see https://discord.com/developers/docs/interactions/application-commands#permissions
1340
- */
1341
- setDMPermission(enabled: boolean | null | undefined): this;
1342
- /**
1343
- * Sets a name localization
1344
- *
1345
- * @param locale - The locale to set a description for
1346
- * @param localizedName - The localized description for the given locale
1347
- */
1348
- setNameLocalization(locale: LocaleString, localizedName: string | null): this;
1349
- /**
1350
- * Sets the name localizations
1351
- *
1352
- * @param localizedNames - The dictionary of localized descriptions to set
1353
- */
1354
- setNameLocalizations(localizedNames: LocalizationMap | null): this;
1355
- /**
1356
- * Returns the final data that should be sent to Discord.
1357
- *
1358
- * **Note:** Calling this function will validate required properties based on their conditions.
1359
- */
1360
- toJSON(): RESTPostAPIApplicationCommandsJSONBody;
1361
- }
1362
- declare type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;
1363
-
1364
- declare function validateDefaultPermission(value: unknown): asserts value is boolean;
1365
- declare function validateName(name: unknown): asserts name is string;
1366
- declare function validateType(type: unknown): asserts type is ContextMenuCommandType;
1367
- declare function validateRequiredParameters(name: string, type: number): void;
1368
- declare function validateDMPermission(value: unknown): asserts value is boolean | null | undefined;
1369
- declare function validateDefaultMemberPermissions(permissions: unknown): string | null | undefined;
1370
-
1371
- declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
1372
- declare const Assertions_validateName: typeof validateName;
1373
- declare const Assertions_validateType: typeof validateType;
1374
- declare const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
1375
- declare const Assertions_validateDMPermission: typeof validateDMPermission;
1376
- declare const Assertions_validateDefaultMemberPermissions: typeof validateDefaultMemberPermissions;
1377
- declare namespace Assertions {
1378
- export {
1379
- Assertions_validateDefaultPermission as validateDefaultPermission,
1380
- Assertions_validateName as validateName,
1381
- Assertions_validateType as validateType,
1382
- Assertions_validateRequiredParameters as validateRequiredParameters,
1383
- Assertions_validateDMPermission as validateDMPermission,
1384
- Assertions_validateDefaultMemberPermissions as validateDefaultMemberPermissions,
1385
- };
1386
- }
1387
-
1388
- interface Equatable<T> {
1389
- /**
1390
- * Whether or not this is equal to another structure
1391
- */
1392
- equals: (other: T) => boolean;
1393
- }
1394
- /**
1395
- * Indicates if an object is equatable or not.
1396
- * @param maybeEquatable - The object to check against
1397
- */
1398
- declare function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable<unknown>;
1399
-
1400
- declare function embedLength(data: APIEmbed): number;
1401
-
1402
- declare const enableValidators: () => boolean;
1403
- declare const disableValidators: () => boolean;
1404
- declare const isValidationEnabled: () => boolean;
1405
-
1406
- export { ActionRowBuilder, AnyAPIActionRowComponent, AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin, ButtonBuilder, Assertions$4 as ComponentAssertions, ComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Assertions$5 as EmbedAssertions, EmbedAuthorData, EmbedAuthorOptions, EmbedBuilder, EmbedFooterData, EmbedFooterOptions, EmbedImageData, Equatable, Faces, IconData, JSONEncodable, MappedComponentTypes, MessageActionRowComponentBuilder, MessageComponentBuilder, ModalActionRowComponentBuilder, Assertions$2 as ModalAssertions, ModalBuilder, ModalComponentBuilder, RGBTuple, RestOrArray, SelectMenuBuilder, SelectMenuOptionBuilder, SharedNameAndDescription, SharedSlashCommandOptions, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, Assertions$3 as TextInputAssertions, TextInputBuilder, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, blockQuote, bold, channelMention, codeBlock, createComponentBuilder, disableValidators, embedLength, enableValidators, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, isEquatable, isJSONEncodable, isValidationEnabled, italic, normalizeArray, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };
1
+ export * as EmbedAssertions from './messages/embed/Assertions';
2
+ export * from './messages/embed/Embed';
3
+ export * from './messages/formatters';
4
+ export * as ComponentAssertions from './components/Assertions';
5
+ export * from './components/ActionRow';
6
+ export * from './components/button/Button';
7
+ export * from './components/Component';
8
+ export * from './components/Components';
9
+ export * from './components/textInput/TextInput';
10
+ export * as TextInputAssertions from './components/textInput/Assertions';
11
+ export * from './interactions/modals/Modal';
12
+ export * as ModalAssertions from './interactions/modals/Assertions';
13
+ export * from './components/selectMenu/SelectMenu';
14
+ export * from './components/selectMenu/SelectMenuOption';
15
+ export * as SlashCommandAssertions from './interactions/slashCommands/Assertions';
16
+ export * from './interactions/slashCommands/SlashCommandBuilder';
17
+ export * from './interactions/slashCommands/SlashCommandSubcommands';
18
+ export * from './interactions/slashCommands/options/boolean';
19
+ export * from './interactions/slashCommands/options/channel';
20
+ export * from './interactions/slashCommands/options/integer';
21
+ export * from './interactions/slashCommands/options/mentionable';
22
+ export * from './interactions/slashCommands/options/number';
23
+ export * from './interactions/slashCommands/options/role';
24
+ export * from './interactions/slashCommands/options/attachment';
25
+ export * from './interactions/slashCommands/options/string';
26
+ export * from './interactions/slashCommands/options/user';
27
+ export * from './interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin';
28
+ export * from './interactions/slashCommands/mixins/ApplicationCommandOptionBase';
29
+ export * from './interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin';
30
+ export * from './interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';
31
+ export * from './interactions/slashCommands/mixins/NameAndDescription';
32
+ export * from './interactions/slashCommands/mixins/SharedSlashCommandOptions';
33
+ export * as ContextMenuCommandAssertions from './interactions/contextMenuCommands/Assertions';
34
+ export * from './interactions/contextMenuCommands/ContextMenuCommandBuilder';
35
+ export * from './util/jsonEncodable';
36
+ export * from './util/equatable';
37
+ export * from './util/componentUtil';
38
+ export * from './util/normalizeArray';
39
+ export * from './util/validation';
40
+ //# sourceMappingURL=index.d.ts.map