commandkit 0.1.10-dev.20240128000000 → 0.1.10-dev.20240131174628

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 (328) hide show
  1. package/bin/index.cjs +3 -0
  2. package/dist/CommandKit--SA9LcIq.d.mts +452 -0
  3. package/dist/CommandKit-GIHMEeqf.d.ts +452 -0
  4. package/dist/CommandKit.d.mts +5 -0
  5. package/dist/CommandKit.d.ts +5 -0
  6. package/dist/CommandKit.js +11 -0
  7. package/dist/CommandKit.js.map +1 -0
  8. package/dist/CommandKit.mjs +2 -0
  9. package/dist/CommandKit.mjs.map +1 -0
  10. package/dist/bootstrap/client.d.mts +13 -0
  11. package/dist/bootstrap/client.d.ts +13 -0
  12. package/dist/bootstrap/client.js +2 -0
  13. package/dist/bootstrap/client.js.map +1 -0
  14. package/dist/bootstrap/client.mjs +2 -0
  15. package/dist/bootstrap/client.mjs.map +1 -0
  16. package/dist/bootstrap/loadEnv.d.mts +3 -0
  17. package/dist/bootstrap/loadEnv.d.ts +3 -0
  18. package/dist/bootstrap/loadEnv.js +2 -0
  19. package/dist/bootstrap/loadEnv.js.map +1 -0
  20. package/dist/bootstrap/loadEnv.mjs +2 -0
  21. package/dist/bootstrap/loadEnv.mjs.map +1 -0
  22. package/dist/chunk-3RMN5A5C.mjs +2 -0
  23. package/dist/chunk-3RMN5A5C.mjs.map +1 -0
  24. package/dist/chunk-47OCM32X.mjs +2 -0
  25. package/dist/chunk-47OCM32X.mjs.map +1 -0
  26. package/dist/chunk-4M5YKUGX.mjs +2 -0
  27. package/dist/chunk-4M5YKUGX.mjs.map +1 -0
  28. package/dist/chunk-5A7S2KUP.mjs +2 -0
  29. package/dist/chunk-5A7S2KUP.mjs.map +1 -0
  30. package/dist/chunk-5NCNVJD5.mjs +4 -0
  31. package/dist/chunk-5NCNVJD5.mjs.map +1 -0
  32. package/dist/chunk-67SR2RRV.mjs +2 -0
  33. package/dist/chunk-67SR2RRV.mjs.map +1 -0
  34. package/dist/chunk-6I5SY5IL.mjs +2 -0
  35. package/dist/chunk-6I5SY5IL.mjs.map +1 -0
  36. package/dist/chunk-7KD7ZCH6.mjs +2 -0
  37. package/dist/chunk-7KD7ZCH6.mjs.map +1 -0
  38. package/dist/chunk-BWCE2PU3.mjs +2 -0
  39. package/dist/chunk-BWCE2PU3.mjs.map +1 -0
  40. package/dist/chunk-CCTUTTKF.mjs +2 -0
  41. package/dist/chunk-CCTUTTKF.mjs.map +1 -0
  42. package/dist/chunk-DJGEQTVH.mjs +2 -0
  43. package/dist/chunk-DJGEQTVH.mjs.map +1 -0
  44. package/dist/chunk-GLH4FCGA.mjs +2 -0
  45. package/dist/chunk-GLH4FCGA.mjs.map +1 -0
  46. package/dist/chunk-KWPUAQ7H.mjs +2 -0
  47. package/dist/chunk-KWPUAQ7H.mjs.map +1 -0
  48. package/dist/chunk-LVMZYYYQ.mjs +2 -0
  49. package/dist/chunk-LVMZYYYQ.mjs.map +1 -0
  50. package/dist/chunk-M5FMJETI.mjs +1 -0
  51. package/dist/chunk-M5FMJETI.mjs.map +1 -0
  52. package/dist/chunk-NAGAOZDU.mjs +2 -0
  53. package/dist/chunk-NAGAOZDU.mjs.map +1 -0
  54. package/dist/chunk-P22KPISA.mjs +2 -0
  55. package/dist/chunk-P22KPISA.mjs.map +1 -0
  56. package/dist/chunk-PFU3PH6M.mjs +1 -0
  57. package/dist/chunk-PFU3PH6M.mjs.map +1 -0
  58. package/dist/chunk-QVM3SASI.mjs +2 -0
  59. package/dist/chunk-QVM3SASI.mjs.map +1 -0
  60. package/dist/chunk-R4SUPDLH.mjs +2 -0
  61. package/dist/chunk-R4SUPDLH.mjs.map +1 -0
  62. package/dist/chunk-RWJJP4OR.mjs +2 -0
  63. package/dist/chunk-RWJJP4OR.mjs.map +1 -0
  64. package/dist/chunk-UWPC5P4C.mjs +2 -0
  65. package/dist/chunk-UWPC5P4C.mjs.map +1 -0
  66. package/dist/chunk-VURGPMLB.mjs +2 -0
  67. package/dist/chunk-VURGPMLB.mjs.map +1 -0
  68. package/dist/chunk-WTRDOPQV.mjs +2 -0
  69. package/dist/chunk-WTRDOPQV.mjs.map +1 -0
  70. package/dist/chunk-XFI3OAJH.mjs +2 -0
  71. package/dist/chunk-XFI3OAJH.mjs.map +1 -0
  72. package/dist/chunk-YVVGY7EA.mjs +7 -0
  73. package/dist/chunk-YVVGY7EA.mjs.map +1 -0
  74. package/dist/chunk-ZBUBSPF6.mjs +4 -0
  75. package/dist/chunk-ZBUBSPF6.mjs.map +1 -0
  76. package/dist/components/ButtonKit.d.mts +55 -0
  77. package/dist/components/ButtonKit.d.ts +55 -0
  78. package/dist/components/ButtonKit.js +2 -0
  79. package/dist/components/ButtonKit.js.map +1 -0
  80. package/dist/components/ButtonKit.mjs +2 -0
  81. package/dist/components/ButtonKit.mjs.map +1 -0
  82. package/dist/components/index.d.mts +2 -0
  83. package/dist/components/index.d.ts +2 -0
  84. package/dist/components/index.js +2 -0
  85. package/dist/components/index.js.map +1 -0
  86. package/dist/components/index.mjs +2 -0
  87. package/dist/components/index.mjs.map +1 -0
  88. package/dist/config.d.mts +55 -0
  89. package/dist/config.d.ts +55 -0
  90. package/dist/config.js +2 -0
  91. package/dist/config.js.map +1 -0
  92. package/dist/config.mjs +2 -0
  93. package/dist/config.mjs.map +1 -0
  94. package/dist/environment/actions/development.d.mts +8 -0
  95. package/dist/environment/actions/development.d.ts +8 -0
  96. package/dist/environment/actions/development.js +2 -0
  97. package/dist/environment/actions/development.js.map +1 -0
  98. package/dist/environment/actions/development.mjs +2 -0
  99. package/dist/environment/actions/development.mjs.map +1 -0
  100. package/dist/environment/bundler/bundle.d.mts +3 -0
  101. package/dist/environment/bundler/bundle.d.ts +3 -0
  102. package/dist/environment/bundler/bundle.js +2 -0
  103. package/dist/environment/bundler/bundle.js.map +1 -0
  104. package/dist/environment/bundler/bundle.mjs +2 -0
  105. package/dist/environment/bundler/bundle.mjs.map +1 -0
  106. package/dist/environment/bundler/shims.d.mts +3 -0
  107. package/dist/environment/bundler/shims.d.ts +3 -0
  108. package/dist/environment/bundler/shims.js +11 -0
  109. package/dist/environment/bundler/shims.js.map +1 -0
  110. package/dist/environment/bundler/shims.mjs +11 -0
  111. package/dist/environment/bundler/shims.mjs.map +1 -0
  112. package/dist/environment/cli.d.mts +2 -0
  113. package/dist/environment/cli.d.ts +2 -0
  114. package/dist/environment/cli.js +2 -0
  115. package/dist/environment/cli.js.map +1 -0
  116. package/dist/environment/cli.mjs +2 -0
  117. package/dist/environment/cli.mjs.map +1 -0
  118. package/dist/environment/common/config.d.mts +7 -0
  119. package/dist/environment/common/config.d.ts +7 -0
  120. package/dist/environment/common/config.js +2 -0
  121. package/dist/environment/common/config.js.map +1 -0
  122. package/dist/environment/common/config.mjs +2 -0
  123. package/dist/environment/common/config.mjs.map +1 -0
  124. package/dist/environment/common/logger.d.mts +9 -0
  125. package/dist/environment/common/logger.d.ts +9 -0
  126. package/dist/environment/common/logger.js +2 -0
  127. package/dist/environment/common/logger.js.map +1 -0
  128. package/dist/environment/common/logger.mjs +2 -0
  129. package/dist/environment/common/logger.mjs.map +1 -0
  130. package/dist/handlers/command-handler/CommandHandler.d.mts +5 -0
  131. package/dist/handlers/command-handler/CommandHandler.d.ts +5 -0
  132. package/dist/handlers/command-handler/CommandHandler.js +11 -0
  133. package/dist/handlers/command-handler/CommandHandler.js.map +1 -0
  134. package/dist/handlers/command-handler/CommandHandler.mjs +2 -0
  135. package/dist/handlers/command-handler/CommandHandler.mjs.map +1 -0
  136. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.mts +35 -0
  137. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.ts +35 -0
  138. package/dist/handlers/command-handler/functions/loadCommandsWithRest.js +4 -0
  139. package/dist/handlers/command-handler/functions/loadCommandsWithRest.js.map +1 -0
  140. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs +2 -0
  141. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs.map +1 -0
  142. package/dist/handlers/command-handler/functions/registerCommands.d.mts +20 -0
  143. package/dist/handlers/command-handler/functions/registerCommands.d.ts +20 -0
  144. package/dist/handlers/command-handler/functions/registerCommands.js +7 -0
  145. package/dist/handlers/command-handler/functions/registerCommands.js.map +1 -0
  146. package/dist/handlers/command-handler/functions/registerCommands.mjs +2 -0
  147. package/dist/handlers/command-handler/functions/registerCommands.mjs.map +1 -0
  148. package/dist/handlers/command-handler/typings.d.mts +5 -0
  149. package/dist/handlers/command-handler/typings.d.ts +5 -0
  150. package/dist/handlers/command-handler/typings.js +2 -0
  151. package/dist/handlers/command-handler/typings.js.map +1 -0
  152. package/dist/handlers/command-handler/typings.mjs +1 -0
  153. package/dist/handlers/command-handler/typings.mjs.map +1 -0
  154. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.mts +9 -0
  155. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.ts +9 -0
  156. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js +2 -0
  157. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js.map +1 -0
  158. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs +2 -0
  159. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs.map +1 -0
  160. package/dist/handlers/command-handler/validations/devOnly.d.mts +9 -0
  161. package/dist/handlers/command-handler/validations/devOnly.d.ts +9 -0
  162. package/dist/handlers/command-handler/validations/devOnly.js +2 -0
  163. package/dist/handlers/command-handler/validations/devOnly.js.map +1 -0
  164. package/dist/handlers/command-handler/validations/devOnly.mjs +2 -0
  165. package/dist/handlers/command-handler/validations/devOnly.mjs.map +1 -0
  166. package/dist/handlers/command-handler/validations/index.d.mts +10 -0
  167. package/dist/handlers/command-handler/validations/index.d.ts +10 -0
  168. package/dist/handlers/command-handler/validations/index.js +4 -0
  169. package/dist/handlers/command-handler/validations/index.js.map +1 -0
  170. package/dist/handlers/command-handler/validations/index.mjs +2 -0
  171. package/dist/handlers/command-handler/validations/index.mjs.map +1 -0
  172. package/dist/handlers/command-handler/validations/permissions.d.mts +9 -0
  173. package/dist/handlers/command-handler/validations/permissions.d.ts +9 -0
  174. package/dist/handlers/command-handler/validations/permissions.js +4 -0
  175. package/dist/handlers/command-handler/validations/permissions.js.map +1 -0
  176. package/dist/handlers/command-handler/validations/permissions.mjs +2 -0
  177. package/dist/handlers/command-handler/validations/permissions.mjs.map +1 -0
  178. package/dist/handlers/event-handler/EventHandler.d.mts +5 -0
  179. package/dist/handlers/event-handler/EventHandler.d.ts +5 -0
  180. package/dist/handlers/event-handler/EventHandler.js +2 -0
  181. package/dist/handlers/event-handler/EventHandler.js.map +1 -0
  182. package/dist/handlers/event-handler/EventHandler.mjs +2 -0
  183. package/dist/handlers/event-handler/EventHandler.mjs.map +1 -0
  184. package/dist/handlers/event-handler/typings.d.mts +5 -0
  185. package/dist/handlers/event-handler/typings.d.ts +5 -0
  186. package/dist/handlers/event-handler/typings.js +2 -0
  187. package/dist/handlers/event-handler/typings.js.map +1 -0
  188. package/dist/handlers/event-handler/typings.mjs +1 -0
  189. package/dist/handlers/event-handler/typings.mjs.map +1 -0
  190. package/dist/handlers/index.d.mts +5 -0
  191. package/dist/handlers/index.d.ts +5 -0
  192. package/dist/handlers/index.js +11 -0
  193. package/dist/handlers/index.js.map +1 -0
  194. package/dist/handlers/index.mjs +2 -0
  195. package/dist/handlers/index.mjs.map +1 -0
  196. package/dist/handlers/validation-handler/ValidationHandler.d.mts +14 -0
  197. package/dist/handlers/validation-handler/ValidationHandler.d.ts +14 -0
  198. package/dist/handlers/validation-handler/ValidationHandler.js +2 -0
  199. package/dist/handlers/validation-handler/ValidationHandler.js.map +1 -0
  200. package/dist/handlers/validation-handler/ValidationHandler.mjs +2 -0
  201. package/dist/handlers/validation-handler/ValidationHandler.mjs.map +1 -0
  202. package/dist/handlers/validation-handler/typings.d.mts +14 -0
  203. package/dist/handlers/validation-handler/typings.d.ts +14 -0
  204. package/dist/handlers/validation-handler/typings.js +2 -0
  205. package/dist/handlers/validation-handler/typings.js.map +1 -0
  206. package/dist/handlers/validation-handler/typings.mjs +1 -0
  207. package/dist/handlers/validation-handler/typings.mjs.map +1 -0
  208. package/dist/hooks/common.d.mts +12 -0
  209. package/dist/hooks/common.d.ts +12 -0
  210. package/dist/hooks/common.js +11 -0
  211. package/dist/hooks/common.js.map +1 -0
  212. package/dist/hooks/common.mjs +2 -0
  213. package/dist/hooks/common.mjs.map +1 -0
  214. package/dist/hooks/index.d.mts +14 -0
  215. package/dist/hooks/index.d.ts +14 -0
  216. package/dist/hooks/index.js +11 -0
  217. package/dist/hooks/index.js.map +1 -0
  218. package/dist/hooks/index.mjs +2 -0
  219. package/dist/hooks/index.mjs.map +1 -0
  220. package/dist/hooks/response.d.mts +7 -0
  221. package/dist/hooks/response.d.ts +7 -0
  222. package/dist/hooks/response.js +11 -0
  223. package/dist/hooks/response.js.map +1 -0
  224. package/dist/hooks/response.mjs +2 -0
  225. package/dist/hooks/response.mjs.map +1 -0
  226. package/dist/hooks/useChannel.d.mts +5 -0
  227. package/dist/hooks/useChannel.d.ts +5 -0
  228. package/dist/hooks/useChannel.js +11 -0
  229. package/dist/hooks/useChannel.js.map +1 -0
  230. package/dist/hooks/useChannel.mjs +2 -0
  231. package/dist/hooks/useChannel.mjs.map +1 -0
  232. package/dist/hooks/useClient.d.mts +5 -0
  233. package/dist/hooks/useClient.d.ts +5 -0
  234. package/dist/hooks/useClient.js +11 -0
  235. package/dist/hooks/useClient.js.map +1 -0
  236. package/dist/hooks/useClient.mjs +2 -0
  237. package/dist/hooks/useClient.mjs.map +1 -0
  238. package/dist/hooks/useCommandData.d.mts +5 -0
  239. package/dist/hooks/useCommandData.d.ts +5 -0
  240. package/dist/hooks/useCommandData.js +11 -0
  241. package/dist/hooks/useCommandData.js.map +1 -0
  242. package/dist/hooks/useCommandData.mjs +2 -0
  243. package/dist/hooks/useCommandData.mjs.map +1 -0
  244. package/dist/hooks/useCommandKit.d.mts +9 -0
  245. package/dist/hooks/useCommandKit.d.ts +9 -0
  246. package/dist/hooks/useCommandKit.js +11 -0
  247. package/dist/hooks/useCommandKit.js.map +1 -0
  248. package/dist/hooks/useCommandKit.mjs +2 -0
  249. package/dist/hooks/useCommandKit.mjs.map +1 -0
  250. package/dist/hooks/useGuild.d.mts +5 -0
  251. package/dist/hooks/useGuild.d.ts +5 -0
  252. package/dist/hooks/useGuild.js +11 -0
  253. package/dist/hooks/useGuild.js.map +1 -0
  254. package/dist/hooks/useGuild.mjs +2 -0
  255. package/dist/hooks/useGuild.mjs.map +1 -0
  256. package/dist/hooks/useInteraction.d.mts +9 -0
  257. package/dist/hooks/useInteraction.d.ts +9 -0
  258. package/dist/hooks/useInteraction.js +11 -0
  259. package/dist/hooks/useInteraction.js.map +1 -0
  260. package/dist/hooks/useInteraction.mjs +2 -0
  261. package/dist/hooks/useInteraction.mjs.map +1 -0
  262. package/dist/hooks/useMember.d.mts +5 -0
  263. package/dist/hooks/useMember.d.ts +5 -0
  264. package/dist/hooks/useMember.js +11 -0
  265. package/dist/hooks/useMember.js.map +1 -0
  266. package/dist/hooks/useMember.mjs +2 -0
  267. package/dist/hooks/useMember.mjs.map +1 -0
  268. package/dist/hooks/useUser.d.mts +5 -0
  269. package/dist/hooks/useUser.d.ts +5 -0
  270. package/dist/hooks/useUser.js +11 -0
  271. package/dist/hooks/useUser.js.map +1 -0
  272. package/dist/hooks/useUser.mjs +2 -0
  273. package/dist/hooks/useUser.mjs.map +1 -0
  274. package/dist/index.d.mts +25 -535
  275. package/dist/index.d.ts +25 -535
  276. package/dist/index.js +6 -5
  277. package/dist/index.js.map +1 -0
  278. package/dist/index.mjs +2 -10
  279. package/dist/index.mjs.map +1 -0
  280. package/dist/types/index.d.mts +5 -0
  281. package/dist/types/index.d.ts +5 -0
  282. package/dist/types/index.js +2 -0
  283. package/dist/types/index.js.map +1 -0
  284. package/dist/types/index.mjs +2 -0
  285. package/dist/types/index.mjs.map +1 -0
  286. package/dist/typings.d.mts +5 -0
  287. package/dist/typings.d.ts +5 -0
  288. package/dist/typings.js +2 -0
  289. package/dist/typings.js.map +1 -0
  290. package/dist/typings.mjs +1 -0
  291. package/dist/typings.mjs.map +1 -0
  292. package/dist/utils/clone.d.mts +3 -0
  293. package/dist/utils/clone.d.ts +3 -0
  294. package/dist/utils/clone.js +2 -0
  295. package/dist/utils/clone.js.map +1 -0
  296. package/dist/utils/clone.mjs +2 -0
  297. package/dist/utils/clone.mjs.map +1 -0
  298. package/dist/utils/colors.d.mts +27 -0
  299. package/dist/utils/colors.d.ts +27 -0
  300. package/dist/utils/colors.js +2 -0
  301. package/dist/utils/colors.js.map +1 -0
  302. package/dist/utils/colors.mjs +2 -0
  303. package/dist/utils/colors.mjs.map +1 -0
  304. package/dist/utils/get-paths.d.mts +4 -0
  305. package/dist/utils/get-paths.d.ts +4 -0
  306. package/dist/utils/get-paths.js +2 -0
  307. package/dist/utils/get-paths.js.map +1 -0
  308. package/dist/utils/get-paths.mjs +2 -0
  309. package/dist/utils/get-paths.mjs.map +1 -0
  310. package/dist/utils/resolve-file-url.d.mts +8 -0
  311. package/dist/utils/resolve-file-url.d.ts +8 -0
  312. package/dist/utils/resolve-file-url.js +2 -0
  313. package/dist/utils/resolve-file-url.js.map +1 -0
  314. package/dist/utils/resolve-file-url.mjs +2 -0
  315. package/dist/utils/resolve-file-url.mjs.map +1 -0
  316. package/dist/utils/signal.d.mts +21 -0
  317. package/dist/utils/signal.d.ts +21 -0
  318. package/dist/utils/signal.js +2 -0
  319. package/dist/utils/signal.js.map +1 -0
  320. package/dist/utils/signal.mjs +2 -0
  321. package/dist/utils/signal.mjs.map +1 -0
  322. package/package.json +67 -57
  323. package/bin/build.mjs +0 -107
  324. package/bin/common.mjs +0 -102
  325. package/bin/development.mjs +0 -168
  326. package/bin/index.mjs +0 -39
  327. package/bin/parse-env.mjs +0 -61
  328. package/bin/production.mjs +0 -83
package/dist/index.d.mts CHANGED
@@ -1,535 +1,25 @@
1
- import * as discord_js from 'discord.js';
2
- import { ChatInputCommandInteraction, ContextMenuCommandInteraction, AutocompleteInteraction, Client, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, PermissionsString, RESTPostAPIApplicationCommandsJSONBody, CacheType, Interaction, ButtonInteraction, Awaitable, Message, InteractionCollectorOptions, ButtonBuilder, PartialTextBasedChannelFields, TextBasedChannel, Guild, GuildMember, APIInteractionGuildMember, User } from 'discord.js';
3
- import { AsyncLocalStorage } from 'async_hooks';
4
-
5
- /**
6
- * Validation handler options (validationsPath).
7
- */
8
- interface ValidationHandlerOptions {
9
- validationsPath: string;
10
- }
11
-
12
- /**
13
- * A handler for command validations.
14
- */
15
- declare class ValidationHandler {
16
- #private;
17
- constructor({ ...options }: ValidationHandlerOptions);
18
- init(): Promise<void>;
19
- get validations(): Function[];
20
- reloadValidations(): Promise<void>;
21
- }
22
-
23
- /**
24
- * Command handler options.
25
- * Similar to CommandKit options in structure.
26
- */
27
- interface CommandHandlerOptions {
28
- /**
29
- * The client created by the user.
30
- */
31
- client: Client;
32
- /**
33
- * Path to the user's commands.
34
- */
35
- commandsPath: string;
36
- /**
37
- * An array of developer guild IDs.
38
- */
39
- devGuildIds: string[];
40
- /**
41
- * An array of developer user IDs.
42
- */
43
- devUserIds: string[];
44
- /**
45
- * An array of developer role IDs.
46
- */
47
- devRoleIds: string[];
48
- /**
49
- * A validation handler instance to run validations before commands.
50
- */
51
- validationHandler?: ValidationHandler;
52
- /**
53
- * A boolean indicating whether to skip CommandKit's built-in validations (permission checking, etc.)
54
- */
55
- skipBuiltInValidations: boolean;
56
- /**
57
- * The CommandKit handler that instantiated this.
58
- */
59
- commandkitInstance: CommandKit;
60
- /**
61
- * A boolean indicating whether to register all commands in bulk.
62
- */
63
- bulkRegister: boolean;
64
- /**
65
- * Whether to enable hooks context.
66
- */
67
- enableHooks: boolean;
68
- }
69
- /**
70
- * Represents a command interaction.
71
- */
72
- type CommandKitInteraction = ChatInputCommandInteraction | ContextMenuCommandInteraction | AutocompleteInteraction;
73
-
74
- /**
75
- * Props for command run functions.
76
- */
77
- interface CommandProps {
78
- /**
79
- * The current command interaction object.
80
- */
81
- interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction | UserContextMenuCommandInteraction | MessageContextMenuCommandInteraction | AutocompleteInteraction;
82
- /**
83
- * The Discord.js client object that CommandKit is handling.
84
- */
85
- client: Client<true>;
86
- /**
87
- * The current CommandKit handler instance.
88
- */
89
- handler: CommandKit;
90
- }
91
- /**
92
- * Props for autocomplete command run functions.
93
- */
94
- interface AutocompleteProps extends CommandProps {
95
- /**
96
- * The current autocomplete command interaction object.
97
- */
98
- interaction: AutocompleteInteraction;
99
- }
100
- /**
101
- * Props for slash (chat input) command run functions.
102
- */
103
- interface SlashCommandProps extends CommandProps {
104
- /**
105
- * The current slash (chat input) command interaction object.
106
- */
107
- interaction: ChatInputCommandInteraction;
108
- }
109
- /**
110
- * Props for context menu command run functions.
111
- */
112
- interface ContextMenuCommandProps extends CommandProps {
113
- /**
114
- * The current context menu command interaction object.
115
- */
116
- interaction: ContextMenuCommandInteraction;
117
- }
118
- /**
119
- * Props for user context menu command run functions.
120
- */
121
- interface UserContextMenuCommandProps extends CommandProps {
122
- interaction: UserContextMenuCommandInteraction;
123
- }
124
- /**
125
- * Props for message context menu command run functions.
126
- */
127
- interface MessageContextMenuCommandProps extends CommandProps {
128
- interaction: MessageContextMenuCommandInteraction;
129
- }
130
- /**
131
- * Props for command validation functions.
132
- */
133
- interface ValidationProps {
134
- /**
135
- * The current command interaction object.
136
- */
137
- interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction | AutocompleteInteraction;
138
- /**
139
- * The Discord.js client object that CommandKit is handling.
140
- */
141
- client: Client<true>;
142
- /**
143
- * The current (local) target command object.
144
- */
145
- commandObj: CommandObject;
146
- /**
147
- * The current CommandKit handler instance.
148
- */
149
- handler: CommandKit;
150
- }
151
- /**
152
- * Additional command configuration options.
153
- */
154
- interface CommandOptions {
155
- /**
156
- * A boolean indicating whether the command is guild-only.
157
- * Used for built-in validation.
158
- *
159
- * @deprecated Use `dm_permission` in the command's `data` object instead.
160
- */
161
- guildOnly?: boolean;
162
- /**
163
- * A boolean indicating whether the command is developer-only.
164
- * Used for registration and built-in validation.
165
- */
166
- devOnly?: boolean;
167
- /**
168
- * A boolean indicating whether the command is deleted/ignored on restart/reload.
169
- */
170
- deleted?: boolean;
171
- /**
172
- * A string or array of permissions that a user needs for the current command to be executed.
173
- * Used for built-in validation.
174
- *
175
- * @example
176
- * userPermissions: 'BanMembers'
177
- * or
178
- * userPermissions: ['BanMembers', 'KickMembers']
179
- */
180
- userPermissions?: PermissionsString | PermissionsString[];
181
- /**
182
- * A string or array of permissions that the bot needs to execute the current command.
183
- * Used for built-in validation.
184
- *
185
- * @example
186
- * botPermissions: 'BanMembers'
187
- * or
188
- * botPermissions: ['BanMembers', 'KickMembers']
189
- */
190
- botPermissions?: PermissionsString | PermissionsString[];
191
- [key: string]: any;
192
- }
193
- type CommandData = RESTPostAPIApplicationCommandsJSONBody;
194
- type CommandObject = {
195
- /**
196
- * An object which defines the structure of the application command.
197
- */
198
- data: CommandData;
199
- /**
200
- * Additional command configuration options.
201
- */
202
- options?: CommandOptions;
203
- /**
204
- * The path to the command file.
205
- */
206
- filePath: string;
207
- /**
208
- * The command's category. Determined based on the command folder.
209
- *
210
- * @example
211
- * ```txt
212
- * "/src/commands/ping.js" -> null
213
- * "/src/commands/Misc/ping.js" -> "Misc"
214
- * ```
215
- */
216
- category: string | null;
217
- [key: string]: any;
218
- };
219
- declare enum ReloadType {
220
- /**
221
- * Reload developer/guild commands.
222
- */
223
- Developer = "dev",
224
- /**
225
- * Reload global commands.
226
- */
227
- Global = "global"
228
- }
229
-
230
- interface hCommandContext {
231
- interaction: CommandKitInteraction;
232
- command: CommandData;
233
- }
234
- /**
235
- * A handler for client application commands.
236
- */
237
- declare class CommandHandler {
238
- #private;
239
- context: AsyncLocalStorage<hCommandContext> | null;
240
- constructor({ ...options }: CommandHandlerOptions);
241
- init(): Promise<void>;
242
- handleCommands(): void;
243
- get commands(): CommandFileObject[];
244
- reloadCommands(type?: ReloadOptions): Promise<void>;
245
- }
246
-
247
- /**
248
- * Options for instantiating a CommandKit handler.
249
- */
250
- interface CommandKitOptions {
251
- /**
252
- * The Discord.js client object to use with CommandKit.
253
- */
254
- client: Client;
255
- /**
256
- * The path to your commands directory.
257
- */
258
- commandsPath?: string;
259
- /**
260
- * The path to your events directory.
261
- */
262
- eventsPath?: string;
263
- /**
264
- * The path to the validations directory.
265
- */
266
- validationsPath?: string;
267
- /**
268
- * List of development guild IDs to restrict devOnly commands to.
269
- */
270
- devGuildIds?: string[];
271
- /**
272
- * List of developer user IDs to restrict devOnly commands to.
273
- */
274
- devUserIds?: string[];
275
- /**
276
- * List of developer role IDs to restrict devOnly commands to.
277
- */
278
- devRoleIds?: string[];
279
- /**
280
- * Skip CommandKit's built-in validations (for devOnly commands).
281
- */
282
- skipBuiltInValidations?: boolean;
283
- /**
284
- * Bulk register application commands instead of one-by-one.
285
- */
286
- bulkRegister?: boolean;
287
- /**
288
- * Options for experimental features.
289
- */
290
- experimental?: {
291
- /**
292
- * Enable hooks. This allows you to utilize hooks such as `useInteraction()` to access the interaction object anywhere inside the command.
293
- */
294
- hooks?: boolean;
295
- };
296
- }
297
- /**
298
- * Represents a command context.
299
- */
300
- interface CommandContext<T extends Interaction, Cached extends CacheType> {
301
- /**
302
- * The interaction that triggered this command.
303
- */
304
- interaction: Interaction<CacheType>;
305
- /**
306
- * The client that instantiated this command.
307
- */
308
- client: Client;
309
- /**
310
- * The command data.
311
- */
312
- handler: CommandKit;
313
- }
314
- /**
315
- * Represents a command file.
316
- */
317
- interface CommandFileObject {
318
- data: CommandData;
319
- options?: CommandOptions;
320
- run: <Cached extends CacheType = CacheType>(ctx: CommandContext<Interaction, Cached>) => Awaited<void>;
321
- autocomplete?: <Cached extends CacheType = CacheType>(ctx: CommandContext<Interaction, Cached>) => Awaited<void>;
322
- filePath: string;
323
- category: string | null;
324
- [key: string]: any;
325
- }
326
- /**
327
- * A reload type for commands.
328
- */
329
- type ReloadOptions = 'dev' | 'global' | ReloadType;
330
-
331
- declare class CommandKit {
332
- #private;
333
- static _instance: CommandKit | null;
334
- /**
335
- * Create a new command and event handler with CommandKit.
336
- *
337
- * @param options - The default CommandKit configuration.
338
- * @see {@link https://commandkit.js.org/docs/commandkit-setup}
339
- */
340
- constructor(options: CommandKitOptions);
341
- /**
342
- * Get the client attached to this CommandKit instance.
343
- */
344
- get client(): discord_js.Client<boolean>;
345
- /**
346
- * Get command handler instance.
347
- */
348
- get commandHandler(): CommandHandler | undefined;
349
- /**
350
- * Updates application commands with the latest from "commandsPath".
351
- */
352
- reloadCommands(type?: ReloadOptions): Promise<void>;
353
- /**
354
- * Updates application events with the latest from "eventsPath".
355
- */
356
- reloadEvents(): Promise<void>;
357
- /**
358
- * Updates application command validations with the latest from "validationsPath".
359
- */
360
- reloadValidations(): Promise<void>;
361
- /**
362
- * @returns An array of objects of all the commands that CommandKit is handling.
363
- */
364
- get commands(): CommandObject[];
365
- /**
366
- * @returns The path to the commands folder which was set when instantiating CommandKit.
367
- */
368
- get commandsPath(): string | undefined;
369
- /**
370
- * @returns The path to the events folder which was set when instantiating CommandKit.
371
- */
372
- get eventsPath(): string | undefined;
373
- /**
374
- * @returns The path to the validations folder which was set when instantiating CommandKit.
375
- */
376
- get validationsPath(): string | undefined;
377
- /**
378
- * @returns An array of all the developer user IDs which was set when instantiating CommandKit.
379
- */
380
- get devUserIds(): string[];
381
- /**
382
- * @returns An array of all the developer guild IDs which was set when instantiating CommandKit.
383
- */
384
- get devGuildIds(): string[];
385
- /**
386
- * @returns An array of all the developer role IDs which was set when instantiating CommandKit.
387
- */
388
- get devRoleIds(): string[];
389
- }
390
-
391
- /**
392
- * The handler to run when a button is clicked. This handler is called with the interaction as the first argument.
393
- * If the first argument is null, it means that the interaction collector has been destroyed.
394
- */
395
- type CommandKitButtonBuilderInteractionCollectorDispatch = (interaction: ButtonInteraction) => Awaitable<void>;
396
- type CommandKitButtonBuilderOnEnd = () => Awaitable<void>;
397
- type CommandKitButtonBuilderInteractionCollectorDispatchContextData = {
398
- /**
399
- * The message to listen for button interactions on.
400
- */
401
- message: Message;
402
- /**
403
- * The duration (in ms) that the collector should run for.
404
- */
405
- time?: number;
406
- /**
407
- * If the collector should automatically reset the timer when a button is clicked.
408
- */
409
- autoReset?: boolean;
410
- } & Omit<InteractionCollectorOptions<ButtonInteraction>, 'filter' | 'componentType'>;
411
- declare class ButtonKit extends ButtonBuilder {
412
- #private;
413
- /**
414
- * Sets up an inline interaction collector for this button. This collector by default allows as many interactions as possible if it is actively used.
415
- * If unused, this expires after 24 hours or custom time if specified.
416
- * @param handler The handler to run when the button is clicked
417
- * @param data The context data to use for the interaction collector
418
- * @returns This button
419
- * @example
420
- * ```ts
421
- * const button = new ButtonKit()
422
- * .setLabel('Click me')
423
- * .setStyle(ButtonStyle.Primary)
424
- * .setCustomId('click_me');
425
- *
426
- * const row = new ActionRowBuilder().addComponents(button);
427
- *
428
- * const message = await channel.send({ content: 'Click the button', components: [row] });
429
- *
430
- * button.onClick(async (interaction) => {
431
- * await interaction.reply('You clicked me!');
432
- * }, { message });
433
- *
434
- * // Remove onClick handler and destroy the interaction collector
435
- * button.onClick(null);
436
- * ```
437
- */
438
- onClick(handler: CommandKitButtonBuilderInteractionCollectorDispatch, data?: CommandKitButtonBuilderInteractionCollectorDispatchContextData): this;
439
- onEnd(handler: CommandKitButtonBuilderOnEnd): this;
440
- dispose(): this;
441
- }
442
-
443
- interface CommandKitConfig {
444
- /**
445
- * The source directory of the project.
446
- */
447
- src: string;
448
- /**
449
- * The main "javascript" file of the project.
450
- */
451
- main: string;
452
- /**
453
- * Whether or not to use the watch mode. Defaults to `true`.
454
- */
455
- watch: boolean;
456
- /**
457
- * The output directory of the project. Defaults to `dist`.
458
- */
459
- outDir: string;
460
- /**
461
- * Whether or not to include extra env utilities. Defaults to `true`.
462
- */
463
- envExtra: boolean;
464
- /**
465
- * Node.js cli options.
466
- */
467
- nodeOptions: string[];
468
- /**
469
- * Whether or not to clear default restart logs. Defaults to `true`.
470
- */
471
- clearRestartLogs: boolean;
472
- /**
473
- * Whether or not to minify the output. Defaults to `false`.
474
- */
475
- minify: boolean;
476
- /**
477
- * Whether or not to include sourcemaps in production build. Defaults to `false`.
478
- */
479
- sourcemap: boolean | 'inline';
480
- /**
481
- * Whether or not to include anti-crash handler in production. Defaults to `true`.
482
- */
483
- antiCrash: boolean;
484
- /**
485
- * Whether or not to polyfill `require` function. Defaults to `true`.
486
- */
487
- requirePolyfill: boolean;
488
- }
489
- declare function getConfig(): CommandKitConfig;
490
- declare const requiredProps: readonly ["src", "main"];
491
- type R = (typeof requiredProps)[number];
492
- type PartialConfig<T extends CommandKitConfig> = Partial<Omit<T, R>> & Pick<T, R>;
493
- declare function defineConfig(config: PartialConfig<CommandKitConfig>): Partial<CommandKitConfig>;
494
-
495
- type CommandKitEffectCallback = () => void;
496
- type CommandKitSignalInitializer<T> = T | (() => T);
497
- type CommandKitSignalUpdater<T> = T | ((prev: T) => T);
498
- type CommandKitSignal<T> = readonly [
499
- () => T,
500
- (value: CommandKitSignalUpdater<T>) => void,
501
- () => void
502
- ];
503
- /**
504
- * Creates a new signal.
505
- * @param value - The initial value to use.
506
- * @returns An array of functions: a getter, a setter, and a disposer.
507
- */
508
- declare function createSignal<T = unknown>(value?: CommandKitSignalInitializer<T>): CommandKitSignal<T>;
509
- /**
510
- * Creates a new effect.
511
- * @param callback - The callback function to execute.
512
- */
513
- declare function createEffect(callback: CommandKitEffectCallback): void;
514
-
515
- declare function useClient(): discord_js.Client<boolean>;
516
-
517
- declare function useCommandKit(): CommandKit;
518
-
519
- type ChatInputReplyData = Parameters<ChatInputCommandInteraction['reply']>[0];
520
- type MessageData = Parameters<PartialTextBasedChannelFields['send']>[0] | ChatInputReplyData;
521
- declare function response(data: MessageData): Promise<void>;
522
-
523
- declare function useChannel(): TextBasedChannel | null;
524
-
525
- declare function useCommandData(): discord_js.RESTPostAPIApplicationCommandsJSONBody;
526
-
527
- declare function useGuild(): Guild | null;
528
-
529
- declare function useInteraction<T extends CommandKitInteraction = CommandKitInteraction>(): T;
530
-
531
- declare function useMember(): GuildMember | APIInteractionGuildMember | null;
532
-
533
- declare function useUser(): User;
534
-
535
- export { type AutocompleteProps, ButtonKit, type CommandData, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfig, type CommandKitEffectCallback, type CommandKitSignal, type CommandKitSignalInitializer, type CommandKitSignalUpdater, type CommandObject, type CommandOptions, type CommandProps, type ContextMenuCommandProps, type MessageContextMenuCommandProps, ReloadType, type SlashCommandProps, type UserContextMenuCommandProps, type ValidationProps, createEffect, createSignal, defineConfig, getConfig, response, useChannel, useClient, useCommandData, useCommandKit, useGuild, useInteraction, useMember, useUser };
1
+ export { A as AutocompleteProps, d as CommandData, C as CommandKit, e as CommandObject, c as CommandOptions, a as CommandProps, b as ContextMenuCommandProps, M as MessageContextMenuCommandProps, R as ReloadType, S as SlashCommandProps, U as UserContextMenuCommandProps, V as ValidationProps } from './CommandKit--SA9LcIq.mjs';
2
+ export { ButtonKit, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd } from './components/ButtonKit.mjs';
3
+ export { CommandKitConfig, defineConfig, getConfig } from './config.mjs';
4
+ export { CommandKitEffectCallback, CommandKitSignal, CommandKitSignalInitializer, CommandKitSignalUpdater, createEffect, createSignal } from './utils/signal.mjs';
5
+ export { useClient } from './hooks/useClient.mjs';
6
+ export { useCommandKit } from './hooks/useCommandKit.mjs';
7
+ export { response } from './hooks/response.mjs';
8
+ export { useChannel } from './hooks/useChannel.mjs';
9
+ export { useCommandData } from './hooks/useCommandData.mjs';
10
+ export { useGuild } from './hooks/useGuild.mjs';
11
+ export { useInteraction } from './hooks/useInteraction.mjs';
12
+ export { useMember } from './hooks/useMember.mjs';
13
+ export { useUser } from './hooks/useUser.mjs';
14
+ export { client } from './bootstrap/client.mjs';
15
+ import './handlers/validation-handler/ValidationHandler.mjs';
16
+ import './handlers/validation-handler/typings.mjs';
17
+ import 'discord.js';
18
+ import 'async_hooks';
19
+
20
+ /**
21
+ * The current version of CommandKit.
22
+ */
23
+ declare const version: string;
24
+
25
+ export { version };