commandkit 1.0.0-dev.20250611020404 → 1.0.0-dev.20250611155146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai.cjs +21 -0
- package/ai.d.ts +1 -0
- package/dist/ActionRow-CmTHbo2t.js.map +1 -1
- package/dist/{ActionRow-D0wafJhZ.d.ts → ActionRow-DKnFVDME.d.ts} +6 -2
- package/dist/{Button-Bl5nbwTS.d.ts → Button-4ZUXdA56.d.ts} +11 -4
- package/dist/{ButtonKit-BSI7lCI0.d.ts → ButtonKit-C7r7RPNf.d.ts} +21 -2
- package/dist/{ChannelSelectMenuKit-L15A2jpT.d.ts → ChannelSelectMenuKit-BrXvBYNH.d.ts} +19 -3
- package/dist/{CommandKit-CnLBu_7m.js → CommandKit-BqZBlSaB.js} +636 -23
- package/dist/CommandKit-BqZBlSaB.js.map +1 -0
- package/dist/{CommandKit-B-mjdP5x.d.ts → CommandKit-g7NqIdUD.d.ts} +826 -12
- package/dist/CommandKit.d.ts +25 -25
- package/dist/CommandKit.js +26 -26
- package/dist/CommandKitEventsChannel-BL_YN3Rm.js +87 -0
- package/dist/CommandKitEventsChannel-BL_YN3Rm.js.map +1 -0
- package/dist/CommandsRouter-CoOA7hkf.d.ts +146 -0
- package/dist/{CommandsRouter-BHaPno8o.js → CommandsRouter-DFRh47qD.js} +87 -1
- package/dist/CommandsRouter-DFRh47qD.js.map +1 -0
- package/dist/{CompilerPlugin-DrnhOC1c.js → CompilerPlugin-Bmy4izKz.js} +13 -2
- package/dist/CompilerPlugin-Bmy4izKz.js.map +1 -0
- package/dist/{CompilerPluginRuntime-C9wmPMQf.js → CompilerPluginRuntime-CgVU_gU0.js} +59 -1
- package/dist/CompilerPluginRuntime-CgVU_gU0.js.map +1 -0
- package/dist/DefaultLogger-pWzrSxMd.d.ts +60 -0
- package/dist/{EventInterceptor-Bvh05z7n.js → EventInterceptor-DWCHCGRh.js} +5 -1
- package/dist/EventInterceptor-DWCHCGRh.js.map +1 -0
- package/dist/{EventInterceptor-D_oEWSnF.d.ts → EventInterceptor-x-R2qshQ.d.ts} +8 -1
- package/dist/{EventWorkerContext-BYXamZ_4.d.ts → EventWorkerContext-BcXmutAi.d.ts} +25 -2
- package/dist/{EventWorkerContext-BAKiTqJz.js → EventWorkerContext-DxfS_0fJ.js} +24 -1
- package/dist/EventWorkerContext-DxfS_0fJ.js.map +1 -0
- package/dist/ILogger-Cs5SFzqd.d.ts +34 -0
- package/dist/Logger-5ew_YS4P.d.ts +37 -0
- package/dist/{MentionableSelectMenuKit-BiUSKUtZ.d.ts → MentionableSelectMenuKit-CPTKqx-O.d.ts} +14 -3
- package/dist/{MessageCommandParser-D02-wpZN.js → MessageCommandParser-Cz-3I-wL.js} +70 -2
- package/dist/MessageCommandParser-Cz-3I-wL.js.map +1 -0
- package/dist/MessageCommandParser-ROLibZPX.d.ts +195 -0
- package/dist/{Modal-Cxm6cs5c.d.ts → Modal-C6UTRdYQ.d.ts} +8 -4
- package/dist/{ModalKit-CKtQ8eXW.d.ts → ModalKit-Btz58KYn.d.ts} +23 -2
- package/dist/{PluginCommon-DPqnQngK.js → PluginCommon-D_Z8Oiic.js} +23 -1
- package/dist/PluginCommon-D_Z8Oiic.js.map +1 -0
- package/dist/{RoleSelectMenuKit-BSMKkru2.d.ts → RoleSelectMenuKit-C26lU3sN.d.ts} +19 -3
- package/dist/{RuntimePlugin-BJoDa8ZR.js → RuntimePlugin-CehKbceZ.js} +5 -2
- package/dist/RuntimePlugin-CehKbceZ.js.map +1 -0
- package/dist/SelectMenu-Diy87_ba.d.ts +137 -0
- package/dist/{StringSelectMenuKit-B9FHTe48.d.ts → StringSelectMenuKit-Bhs8U6WI.d.ts} +19 -3
- package/dist/{UserSelectMenuKit-DiP0imyo.d.ts → UserSelectMenuKit-CfqFJdxz.d.ts} +19 -3
- package/dist/analytics/analytics-engine.d.ts +25 -25
- package/dist/analytics/analytics-engine.js +26 -26
- package/dist/analytics/analytics-provider.d.ts +25 -25
- package/dist/analytics/constants.d.ts +13 -0
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.d.ts +13 -0
- package/dist/analytics/utils.js +26 -26
- package/dist/app/commands/AppCommandRunner.d.ts +26 -26
- package/dist/app/commands/AppCommandRunner.js +26 -26
- package/dist/app/commands/Context.d.ts +25 -25
- package/dist/app/commands/Context.js +26 -26
- package/dist/app/commands/MessageCommandParser.d.ts +1 -1
- package/dist/app/commands/MessageCommandParser.js +2 -2
- package/dist/app/commands/helpers.d.ts +1 -1
- package/dist/app/commands/helpers.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +26 -26
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +26 -26
- package/dist/app/handlers/AppCommandHandler.js +26 -26
- package/dist/app/handlers/AppEventsHandler.d.ts +25 -25
- package/dist/app/handlers/AppEventsHandler.js +26 -26
- package/dist/app/index.d.ts +26 -26
- package/dist/app/index.js +27 -27
- package/dist/app/middleware/signals.js +2 -2
- package/dist/app/register/CommandRegistrar.d.ts +25 -25
- package/dist/app/register/CommandRegistrar.js +26 -26
- package/dist/app/router/CommandsRouter.d.ts +1 -1
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/index.d.ts +1 -1
- package/dist/app/router/index.js +1 -1
- package/dist/{app-process-YbSHvqf-.js → app-process-Bo-LedP8.js} +11 -3
- package/dist/app-process-Bo-LedP8.js.map +1 -0
- package/dist/{build-BejatFZX.js → build-B-Ae1hqg.js} +14 -6
- package/dist/build-B-Ae1hqg.js.map +1 -0
- package/dist/cli/app-process.d.ts +5 -0
- package/dist/cli/app-process.js +5 -5
- package/dist/cli/build.d.ts +33 -25
- package/dist/cli/build.js +29 -29
- package/dist/cli/common.d.ts +57 -27
- package/dist/cli/common.js +3 -3
- package/dist/cli/development.d.ts +4 -0
- package/dist/cli/development.js +46 -30
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.d.ts +32 -0
- package/dist/cli/env.js +1 -1
- package/dist/cli/generators.d.ts +8 -0
- package/dist/cli/generators.js +27 -3
- package/dist/cli/generators.js.map +1 -1
- package/dist/cli/information.d.ts +4 -0
- package/dist/cli/information.js +17 -1
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.js +27 -27
- package/dist/cli/production.d.ts +9 -0
- package/dist/cli/production.js +39 -31
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.d.ts +2 -0
- package/dist/cli/type-checker.js +4 -4
- package/dist/cli/utils.d.ts +5 -0
- package/dist/cli/utils.js +1 -1
- package/dist/{common-pvPJVTfe.d.ts → common-DOCvOVC4.d.ts} +7 -2
- package/dist/{common-CW8v7gAn.js → common-Dasi9oKU.js} +44 -2
- package/dist/common-Dasi9oKU.js.map +1 -0
- package/dist/{common-CeO-vn8Y.js → common-vnMIelAE.js} +4 -1
- package/dist/common-vnMIelAE.js.map +1 -0
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/EventInterceptor.js +1 -1
- package/dist/components/common/element.d.ts +4 -4
- package/dist/components/common/element.js +2 -2
- package/dist/components/index.d.ts +20 -20
- package/dist/components/index.js +26 -26
- package/dist/components/v1/action-row/ActionRow.d.ts +5 -5
- package/dist/components/v1/button/Button.d.ts +5 -5
- package/dist/components/v1/button/Button.js +26 -26
- package/dist/components/v1/button/ButtonKit.d.ts +2 -2
- package/dist/components/v1/button/ButtonKit.js +26 -26
- package/dist/components/v1/modal/Modal.d.ts +5 -5
- package/dist/components/v1/modal/Modal.js +26 -26
- package/dist/components/v1/modal/ModalKit.d.ts +2 -2
- package/dist/components/v1/modal/ModalKit.js +26 -26
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/SelectMenu.d.ts +8 -8
- package/dist/components/v1/select-menu/SelectMenu.js +26 -26
- package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/common.d.ts +2 -2
- package/dist/components/v2/common.d.ts +4 -0
- package/dist/components/v2/common.js +1 -1
- package/dist/components/v2/container.d.ts +1 -1
- package/dist/components/v2/container.js +2 -2
- package/dist/components/v2/file.d.ts +1 -1
- package/dist/components/v2/file.js +1 -1
- package/dist/components/v2/index.d.ts +6 -6
- package/dist/components/v2/index.js +7 -7
- package/dist/components/v2/media-gallery.d.ts +1 -1
- package/dist/components/v2/media-gallery.js +2 -2
- package/dist/components/v2/section.d.ts +1 -1
- package/dist/components/v2/section.js +2 -2
- package/dist/components/v2/separator.d.ts +1 -1
- package/dist/components/v2/separator.js +1 -1
- package/dist/components/v2/text-display.d.ts +1 -1
- package/dist/components/v2/text-display.js +1 -1
- package/dist/config/config.d.ts +28 -28
- package/dist/config/config.js +26 -26
- package/dist/config/default.d.ts +30 -27
- package/dist/config/default.js +26 -26
- package/dist/config/loader.d.ts +33 -27
- package/dist/config/loader.js +26 -26
- package/dist/config/types.d.ts +26 -26
- package/dist/config/utils.d.ts +27 -27
- package/dist/config/utils.js +3 -0
- package/dist/config/utils.js.map +1 -1
- package/dist/{config-BjmEZYpx.d.ts → config-CGECBFwj.d.ts} +3 -3
- package/dist/constants-BTttfrm3.d.ts +42 -0
- package/dist/{constants-DWe181uQ.js → constants-CXwjhIYH.js} +9 -1
- package/dist/constants-CXwjhIYH.js.map +1 -0
- package/dist/{constants-CCqS_v55.js → constants-DDRctWlU.js} +14 -8
- package/dist/constants-DDRctWlU.js.map +1 -0
- package/dist/{container-CpuiLsZM.js → container-DCjIgp-B.js} +12 -2
- package/dist/container-DCjIgp-B.js.map +1 -0
- package/dist/container-DaUKKPm-.d.ts +24 -0
- package/dist/context/async-context.d.ts +25 -25
- package/dist/context/async-context.js +26 -26
- package/dist/context/environment.d.ts +25 -25
- package/dist/context/environment.js +26 -26
- package/dist/element-CAXu1XtK.d.ts +72 -0
- package/dist/{element-DcqNz1dV.js → element-Cq-LoDjk.js} +27 -2
- package/dist/element-Cq-LoDjk.js.map +1 -0
- package/dist/{env-ERkaRfQO.js → env-DemeP-uq.js} +33 -1
- package/dist/env-DemeP-uq.js.map +1 -0
- package/dist/{error-codes-C_UO39jz.js → error-codes-CxlUBdF6.js} +20 -1
- package/dist/error-codes-CxlUBdF6.js.map +1 -0
- package/dist/events/CommandKitEventsChannel.d.ts +25 -25
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{feature-flags-BFiGn38a.js → feature-flags-CvHcOB7L.js} +4 -4
- package/dist/feature-flags-CvHcOB7L.js.map +1 -0
- package/dist/file-DTrr-p09.d.ts +24 -0
- package/dist/{file-DE69SSOP.js → file-DVZC0QXI.js} +11 -1
- package/dist/file-DVZC0QXI.js.map +1 -0
- package/dist/flags/FlagProvider.d.ts +25 -25
- package/dist/flags/feature-flags.d.ts +25 -25
- package/dist/flags/feature-flags.js +27 -27
- package/dist/flags/store.d.ts +25 -25
- package/dist/flags/store.js +1 -1
- package/dist/{helpers-CswC9gKF.js → helpers-CnfXqF_k.js} +11 -1
- package/dist/helpers-CnfXqF_k.js.map +1 -0
- package/dist/helpers-Wg6P5fRQ.d.ts +23 -0
- package/dist/index.d.ts +34 -34
- package/dist/index.js +30 -31
- package/dist/{init-BDgyvx9E.js → init-BQgLOfl_.js} +6 -6
- package/dist/{init-BDgyvx9E.js.map → init-BQgLOfl_.js.map} +1 -1
- package/dist/logger/DefaultLogger.d.ts +2 -2
- package/dist/logger/DefaultLogger.js +26 -26
- package/dist/logger/ILogger.d.ts +1 -1
- package/dist/logger/Logger.d.ts +2 -2
- package/dist/logger/Logger.js +26 -26
- package/dist/media-gallery-BMsXSot3.d.ts +49 -0
- package/dist/{media-gallery-nUEHqKVF.js → media-gallery-CIKypjbJ.js} +27 -2
- package/dist/media-gallery-CIKypjbJ.js.map +1 -0
- package/dist/plugins/CompilerPlugin.d.ts +25 -25
- package/dist/plugins/CompilerPlugin.js +2 -2
- package/dist/plugins/PluginCommon.d.ts +25 -25
- package/dist/plugins/PluginCommon.js +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +25 -25
- package/dist/plugins/RuntimePlugin.js +2 -2
- package/dist/plugins/index.d.ts +25 -25
- package/dist/plugins/index.js +26 -26
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +25 -25
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +26 -26
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +25 -25
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +25 -25
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +26 -26
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +37 -25
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +26 -26
- package/dist/plugins/plugin-runtime/runtime.d.ts +25 -25
- package/dist/plugins/types.d.ts +25 -25
- package/dist/{section-D6t7tyEZ.js → section-CuYr0Inu.js} +22 -2
- package/dist/section-CuYr0Inu.js.map +1 -0
- package/dist/section-Dh_FhPeC.d.ts +45 -0
- package/dist/separator-CMf6Cyy5.d.ts +22 -0
- package/dist/{separator-DYAFK-Jj.js → separator-DLdWBjSN.js} +11 -1
- package/dist/separator-DLdWBjSN.js.map +1 -0
- package/dist/{signals-scJdEbly.js → signals-CSSSZAZ6.js} +2 -2
- package/dist/{signals-scJdEbly.js.map → signals-CSSSZAZ6.js.map} +1 -1
- package/dist/{store-Ci6ib2C9.js → store-x93NXUy_.js} +5 -1
- package/dist/store-x93NXUy_.js.map +1 -0
- package/dist/{text-display-Dy6JHB5X.js → text-display--p2-BoUa.js} +13 -1
- package/dist/text-display--p2-BoUa.js.map +1 -0
- package/dist/text-display-DRw3r_lK.d.ts +33 -0
- package/dist/{type-checker-CXVdS7qc.js → type-checker-P8oyY259.js} +6 -2
- package/dist/type-checker-P8oyY259.js.map +1 -0
- package/dist/{types-package-CTSNSM93.js → types-package-BpY3acyl.js} +8 -2
- package/dist/types-package-BpY3acyl.js.map +1 -0
- package/dist/{types-DjL43eQS.d.ts → types-uBjT82V4.d.ts} +2 -2
- package/dist/types.d.ts +25 -25
- package/dist/{utilities-DQT4lzAB.d.ts → utilities-D_MFPmTe.d.ts} +45 -2
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -2
- package/dist/utils/dev-hooks.d.ts +26 -26
- package/dist/utils/dev-hooks.js +26 -26
- package/dist/utils/error-codes.d.ts +34 -0
- package/dist/utils/error-codes.js +1 -1
- package/dist/utils/types-package.d.ts +6 -0
- package/dist/utils/types-package.js +2 -2
- package/dist/utils/utilities.d.ts +1 -1
- package/dist/utils/utilities.js +26 -26
- package/dist/utils/warn-unstable.d.ts +10 -0
- package/dist/utils/warn-unstable.js +1 -1
- package/dist/{utils-VCdd7XhD.d.ts → utils-Bz_BoOnV.d.ts} +12 -2
- package/dist/{utils-IYtoeTur.js → utils-C8a_hMvn.js} +5 -1
- package/dist/utils-C8a_hMvn.js.map +1 -0
- package/dist/{version-CS1EiTrw.js → version-AMyvJ7I3.js} +5 -2
- package/dist/version-AMyvJ7I3.js.map +1 -0
- package/dist/version.js +1 -1
- package/dist/{warn-unstable-DHLaxPC8.js → warn-unstable-CttBdmlS.js} +11 -1
- package/dist/warn-unstable-CttBdmlS.js.map +1 -0
- package/package.json +10 -3
- package/dist/CommandKit-CnLBu_7m.js.map +0 -1
- package/dist/CommandKitEventsChannel-B6LKgxmv.js +0 -44
- package/dist/CommandKitEventsChannel-B6LKgxmv.js.map +0 -1
- package/dist/CommandsRouter-BHaPno8o.js.map +0 -1
- package/dist/CommandsRouter-C7X-eXE2.d.ts +0 -67
- package/dist/CompilerPlugin-DrnhOC1c.js.map +0 -1
- package/dist/CompilerPluginRuntime-C9wmPMQf.js.map +0 -1
- package/dist/DefaultLogger-CcW-Fuq5.d.ts +0 -30
- package/dist/EventInterceptor-Bvh05z7n.js.map +0 -1
- package/dist/EventWorkerContext-BAKiTqJz.js.map +0 -1
- package/dist/ILogger-kqwb2kUu.d.ts +0 -11
- package/dist/Logger-B4B_URL-.d.ts +0 -17
- package/dist/MessageCommandParser-D02-wpZN.js.map +0 -1
- package/dist/MessageCommandParser-tzroBwij.d.ts +0 -62
- package/dist/PluginCommon-DPqnQngK.js.map +0 -1
- package/dist/RuntimePlugin-BJoDa8ZR.js.map +0 -1
- package/dist/SelectMenu-b7jgrkjO.d.ts +0 -36
- package/dist/app-process-YbSHvqf-.js.map +0 -1
- package/dist/build-BejatFZX.js.map +0 -1
- package/dist/common-CW8v7gAn.js.map +0 -1
- package/dist/common-CeO-vn8Y.js.map +0 -1
- package/dist/constants-BPWSrMkn.d.ts +0 -18
- package/dist/constants-CCqS_v55.js.map +0 -1
- package/dist/constants-DWe181uQ.js.map +0 -1
- package/dist/container-CpuiLsZM.js.map +0 -1
- package/dist/container-CwEATQy2.d.ts +0 -10
- package/dist/element-D_nyVwgB.d.ts +0 -30
- package/dist/element-DcqNz1dV.js.map +0 -1
- package/dist/env-ERkaRfQO.js.map +0 -1
- package/dist/error-codes-C_UO39jz.js.map +0 -1
- package/dist/feature-flags-BFiGn38a.js.map +0 -1
- package/dist/file-BdyYwkaI.d.ts +0 -10
- package/dist/file-DE69SSOP.js.map +0 -1
- package/dist/helpers-CswC9gKF.js.map +0 -1
- package/dist/helpers-DAmE106r.d.ts +0 -9
- package/dist/media-gallery-DCu02VXc.d.ts +0 -17
- package/dist/media-gallery-nUEHqKVF.js.map +0 -1
- package/dist/section-D6t7tyEZ.js.map +0 -1
- package/dist/section-fktaECHL.d.ts +0 -18
- package/dist/separator-CuesaLrC.d.ts +0 -8
- package/dist/separator-DYAFK-Jj.js.map +0 -1
- package/dist/store-Ci6ib2C9.js.map +0 -1
- package/dist/text-display-DNMwmGHJ.d.ts +0 -12
- package/dist/text-display-Dy6JHB5X.js.map +0 -1
- package/dist/type-checker-CXVdS7qc.js.map +0 -1
- package/dist/types-package-CTSNSM93.js.map +0 -1
- package/dist/utils/clone.d.ts +0 -5
- package/dist/utils/clone.js +0 -9
- package/dist/utils/clone.js.map +0 -1
- package/dist/utils/get-paths.d.ts +0 -6
- package/dist/utils/get-paths.js +0 -34
- package/dist/utils/get-paths.js.map +0 -1
- package/dist/utils-IYtoeTur.js.map +0 -1
- package/dist/version-CS1EiTrw.js.map +0 -1
- package/dist/warn-unstable-DHLaxPC8.js.map +0 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType, Attachment, CommandInteractionOption, GuildMember, Message, Role, User } from "discord.js";
|
|
2
|
+
import { Channel } from "diagnostics_channel";
|
|
3
|
+
|
|
4
|
+
//#region src/app/commands/MessageCommandParser.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents a parsed message command with its components.
|
|
8
|
+
*/
|
|
9
|
+
interface ParsedMessageCommand {
|
|
10
|
+
command: string;
|
|
11
|
+
options: {
|
|
12
|
+
name: string;
|
|
13
|
+
value: unknown;
|
|
14
|
+
}[];
|
|
15
|
+
subcommand?: string;
|
|
16
|
+
subcommandGroup?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Schema defining the types of options for a message command.
|
|
20
|
+
*/
|
|
21
|
+
type MessageCommandOptionsSchema = Record<string, ApplicationCommandOptionType>;
|
|
22
|
+
/**
|
|
23
|
+
* Parses message content into structured command data with options and subcommands.
|
|
24
|
+
*/
|
|
25
|
+
declare class MessageCommandParser {
|
|
26
|
+
#private;
|
|
27
|
+
message: Message;
|
|
28
|
+
private prefix;
|
|
29
|
+
private schema;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new message command parser.
|
|
32
|
+
* @param message - The Discord message to parse
|
|
33
|
+
* @param prefix - Array of valid command prefixes
|
|
34
|
+
* @param schema - Function that returns the options schema for a command
|
|
35
|
+
*/
|
|
36
|
+
constructor(message: Message, prefix: string[], schema: (command: string) => MessageCommandOptionsSchema);
|
|
37
|
+
/**
|
|
38
|
+
* Gets the parsed command arguments.
|
|
39
|
+
* @returns Array of command arguments
|
|
40
|
+
*/
|
|
41
|
+
getArgs(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Gets the message command options object for easy access to typed option values.
|
|
44
|
+
*/
|
|
45
|
+
get options(): MessageCommandOptions;
|
|
46
|
+
/**
|
|
47
|
+
* Gets a specific option value by name.
|
|
48
|
+
* @param name - The option name
|
|
49
|
+
* @returns The option value or undefined if not found
|
|
50
|
+
*/
|
|
51
|
+
getOption<T>(name: string): T | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the main command name.
|
|
54
|
+
* @returns The command name
|
|
55
|
+
*/
|
|
56
|
+
getCommand(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Gets the subcommand name if present.
|
|
59
|
+
* @returns The subcommand name or undefined
|
|
60
|
+
*/
|
|
61
|
+
getSubcommand(): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Gets the subcommand group name if present.
|
|
64
|
+
* @returns The subcommand group name or undefined
|
|
65
|
+
*/
|
|
66
|
+
getSubcommandGroup(): string | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the prefix used in the message.
|
|
69
|
+
* @returns The matched prefix or undefined
|
|
70
|
+
*/
|
|
71
|
+
getPrefix(): string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the full command including subcommand group and subcommand.
|
|
74
|
+
* @returns The complete command string
|
|
75
|
+
*/
|
|
76
|
+
getFullCommand(): string;
|
|
77
|
+
/**
|
|
78
|
+
* Parses the message content into structured command data.
|
|
79
|
+
* @returns The parsed command data
|
|
80
|
+
*/
|
|
81
|
+
parse(): ParsedMessageCommand;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Provides typed access to message command options with methods similar to Discord.js interaction options.
|
|
85
|
+
*/
|
|
86
|
+
declare class MessageCommandOptions {
|
|
87
|
+
private parser;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a new message command options instance.
|
|
90
|
+
* @param parser - The message command parser instance
|
|
91
|
+
*/
|
|
92
|
+
constructor(parser: MessageCommandParser);
|
|
93
|
+
/**
|
|
94
|
+
* @private
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
private assertOption;
|
|
98
|
+
/**
|
|
99
|
+
* Gets a guild member from the command options.
|
|
100
|
+
* @param name - The option name
|
|
101
|
+
* @param required - Whether the option is required
|
|
102
|
+
* @returns The guild member or null if not found
|
|
103
|
+
*/
|
|
104
|
+
getMember(name: string): GuildMember | null;
|
|
105
|
+
getMember(name: string, required: true): GuildMember;
|
|
106
|
+
/**
|
|
107
|
+
* Gets an attachment from the command options.
|
|
108
|
+
* @param name - The option name
|
|
109
|
+
* @param required - Whether the option is required
|
|
110
|
+
* @returns The attachment or null if not found
|
|
111
|
+
*/
|
|
112
|
+
getAttachment(name: string): Attachment | null;
|
|
113
|
+
getAttachment(name: string, required: true): Attachment;
|
|
114
|
+
/**
|
|
115
|
+
* Gets a boolean value from the command options.
|
|
116
|
+
* @param name - The option name
|
|
117
|
+
* @param required - Whether the option is required
|
|
118
|
+
* @returns The boolean value or null if not found
|
|
119
|
+
*/
|
|
120
|
+
getBoolean(name: string): boolean | null;
|
|
121
|
+
getBoolean(name: string, required: true): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Gets a number value from the command options.
|
|
124
|
+
* @param name - The option name
|
|
125
|
+
* @param required - Whether the option is required
|
|
126
|
+
* @returns The number value or null if not found
|
|
127
|
+
*/
|
|
128
|
+
getNumber(name: string): number | null;
|
|
129
|
+
getNumber(name: string, required: true): number;
|
|
130
|
+
/**
|
|
131
|
+
* Gets a string value from the command options.
|
|
132
|
+
* @param name - The option name
|
|
133
|
+
* @param required - Whether the option is required
|
|
134
|
+
* @returns The string value or null if not found
|
|
135
|
+
*/
|
|
136
|
+
getString(name: string): string | null;
|
|
137
|
+
getString(name: string, required: true): string;
|
|
138
|
+
/**
|
|
139
|
+
* Gets an integer value from the command options.
|
|
140
|
+
* @param name - The option name
|
|
141
|
+
* @param required - Whether the option is required
|
|
142
|
+
* @returns The integer value or null if not found
|
|
143
|
+
*/
|
|
144
|
+
getInteger(name: string): number | null;
|
|
145
|
+
getInteger(name: string, required: true): number;
|
|
146
|
+
/**
|
|
147
|
+
* Gets a user from the command options.
|
|
148
|
+
* @param name - The option name
|
|
149
|
+
* @param required - Whether the option is required
|
|
150
|
+
* @returns The user or null if not found
|
|
151
|
+
*/
|
|
152
|
+
getUser(name: string): User | null;
|
|
153
|
+
getUser(name: string, required: true): User;
|
|
154
|
+
/**
|
|
155
|
+
* Gets a channel from the command options.
|
|
156
|
+
* @param name - The option name
|
|
157
|
+
* @param required - Whether the option is required
|
|
158
|
+
* @returns The channel or null if not found
|
|
159
|
+
*/
|
|
160
|
+
getChannel(name: string): Channel | null;
|
|
161
|
+
getChannel(name: string, required: true): Channel;
|
|
162
|
+
/**
|
|
163
|
+
* Gets a role from the command options.
|
|
164
|
+
* @param name - The option name
|
|
165
|
+
* @param required - Whether the option is required
|
|
166
|
+
* @returns The role or null if not found
|
|
167
|
+
*/
|
|
168
|
+
getRole(name: string): Role | null;
|
|
169
|
+
getRole(name: string, required: true): Role;
|
|
170
|
+
/**
|
|
171
|
+
* Gets a mentionable (user, member, or role) from the command options.
|
|
172
|
+
* @param name - The option name
|
|
173
|
+
* @param required - Whether the option is required
|
|
174
|
+
* @returns The mentionable or null if not found
|
|
175
|
+
*/
|
|
176
|
+
getMentionable(name: string): NonNullable<CommandInteractionOption['member' | 'role' | 'user']> | null;
|
|
177
|
+
getMentionable(name: string, required: true): NonNullable<CommandInteractionOption['member' | 'role' | 'user']>;
|
|
178
|
+
/**
|
|
179
|
+
* Gets the subcommand name from the command.
|
|
180
|
+
* @param required - Whether the subcommand is required
|
|
181
|
+
* @returns The subcommand name or null if not found
|
|
182
|
+
*/
|
|
183
|
+
getSubcommand(): string | null;
|
|
184
|
+
getSubcommand(required: true): string;
|
|
185
|
+
/**
|
|
186
|
+
* Gets the subcommand group name from the command.
|
|
187
|
+
* @param required - Whether the subcommand group is required
|
|
188
|
+
* @returns The subcommand group name or null if not found
|
|
189
|
+
*/
|
|
190
|
+
getSubcommandGroup(): string | null;
|
|
191
|
+
getSubcommandGroup(required: true): string;
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, ParsedMessageCommand };
|
|
195
|
+
//# sourceMappingURL=MessageCommandParser-ROLibZPX.d.ts.map
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-
|
|
2
|
-
import { CommandKitModalBuilderInteractionCollectorDispatchContextData, OnModalKitEnd, OnModalKitSubmit } from "./ModalKit-
|
|
3
|
-
import { CommandKitElement } from "./element-
|
|
1
|
+
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
+
import { CommandKitModalBuilderInteractionCollectorDispatchContextData, OnModalKitEnd, OnModalKitSubmit } from "./ModalKit-Btz58KYn.js";
|
|
3
|
+
import { CommandKitElement } from "./element-CAXu1XtK.js";
|
|
4
4
|
import { MaybeArray } from "./types-CJ-XvOFN.js";
|
|
5
5
|
import { ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js";
|
|
6
6
|
|
|
7
7
|
//#region src/components/v1/modal/Modal.d.ts
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The properties for the modal component.
|
|
11
|
+
*/
|
|
8
12
|
interface ModalProps {
|
|
9
13
|
customId?: string;
|
|
10
14
|
title: string;
|
|
@@ -55,4 +59,4 @@ declare function ShortInput(props: TextInputProps): CommandKitElement<'text-inpu
|
|
|
55
59
|
declare function ParagraphInput(props: TextInputProps): CommandKitElement<'text-input'>;
|
|
56
60
|
//#endregion
|
|
57
61
|
export { Modal, ModalProps, ParagraphInput, ShortInput, TextInput, TextInputProps };
|
|
58
|
-
//# sourceMappingURL=Modal-
|
|
62
|
+
//# sourceMappingURL=Modal-C6UTRdYQ.d.ts.map
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { EventInterceptorContextData, EventInterceptorErrorHandler } from "./EventInterceptor-
|
|
1
|
+
import { EventInterceptorContextData, EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
2
|
import { Awaitable, Events, ModalBuilder, ModalSubmitInteraction } from "discord.js";
|
|
3
3
|
|
|
4
4
|
//#region src/components/v1/modal/ModalKit.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The predicate function that filters modal interactions.
|
|
8
|
+
* It receives a ModalSubmitInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
9
|
+
*/
|
|
5
10
|
type ModalKitPredicate = (interaction: ModalSubmitInteraction) => Awaitable<boolean>;
|
|
6
11
|
/**
|
|
7
12
|
* The handler to run when a modal is submitted. This handler is called with the interaction as the first argument.
|
|
@@ -18,8 +23,21 @@ type OnModalKitEnd = CommandKitModalBuilderOnEnd;
|
|
|
18
23
|
* If the first argument is null, it means that the interaction collector has been destroyed.
|
|
19
24
|
*/
|
|
20
25
|
type CommandKitModalBuilderInteractionCollectorDispatch = (interaction: ModalSubmitInteraction, context: ModalKit) => Awaitable<void>;
|
|
26
|
+
/**
|
|
27
|
+
* The handler to run when the interaction collector ends. This handler is called with the reason as the first argument.
|
|
28
|
+
* If the first argument is null, it means that the interaction collector has been destroyed.
|
|
29
|
+
*/
|
|
21
30
|
type CommandKitModalBuilderOnEnd = (reason: string) => Awaitable<void>;
|
|
31
|
+
/**
|
|
32
|
+
* The context data for the interaction collector.
|
|
33
|
+
* This includes the autoReset, time, filter, onEnd, and onError properties.
|
|
34
|
+
*/
|
|
22
35
|
type CommandKitModalBuilderInteractionCollectorDispatchContextData = EventInterceptorContextData<Events.InteractionCreate>;
|
|
36
|
+
/**
|
|
37
|
+
* A builder for creating modals with additional features like interaction collectors and event handling.
|
|
38
|
+
* This class extends the ModalBuilder from discord.js and adds methods for handling interactions.
|
|
39
|
+
* It allows you to set a handler for when the modal is submitted, filter interactions, and handle the end of the interaction collector.
|
|
40
|
+
*/
|
|
23
41
|
declare class ModalKit extends ModalBuilder {
|
|
24
42
|
#private;
|
|
25
43
|
/**
|
|
@@ -59,8 +77,11 @@ declare class ModalKit extends ModalBuilder {
|
|
|
59
77
|
*/
|
|
60
78
|
filter(predicate: ModalKitPredicate): this;
|
|
61
79
|
private get customId();
|
|
80
|
+
/**
|
|
81
|
+
* Disposes of the modal collector and cleans up resources.
|
|
82
|
+
*/
|
|
62
83
|
dispose(): this;
|
|
63
84
|
}
|
|
64
85
|
//#endregion
|
|
65
86
|
export { CommandKitModalBuilderInteractionCollectorDispatch, CommandKitModalBuilderInteractionCollectorDispatchContextData, CommandKitModalBuilderOnEnd, ModalKit, ModalKitPredicate, OnModalKitEnd, OnModalKitSubmit };
|
|
66
|
-
//# sourceMappingURL=ModalKit-
|
|
87
|
+
//# sourceMappingURL=ModalKit-Btz58KYn.d.ts.map
|
|
@@ -2,14 +2,31 @@ const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
|
2
2
|
const node_crypto = require_chunk.__toESM(require("node:crypto"));
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/PluginCommon.ts
|
|
5
|
+
/**
|
|
6
|
+
* Enum representing the type of plugin.
|
|
7
|
+
* - Compiler: A plugin that runs at compile time.
|
|
8
|
+
* - Runtime: A plugin that runs at runtime.
|
|
9
|
+
*/
|
|
5
10
|
let PluginType = /* @__PURE__ */ function(PluginType$1) {
|
|
6
11
|
PluginType$1["Compiler"] = "compiler";
|
|
7
12
|
PluginType$1["Runtime"] = "runtime";
|
|
8
13
|
return PluginType$1;
|
|
9
14
|
}({});
|
|
15
|
+
/**
|
|
16
|
+
* Base class for CommandKit plugins.
|
|
17
|
+
*/
|
|
10
18
|
var PluginCommon = class {
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier for the plugin instance.
|
|
21
|
+
*/
|
|
11
22
|
id = (0, node_crypto.randomUUID)();
|
|
23
|
+
/**
|
|
24
|
+
* The time when the plugin was loaded, in milliseconds since the Unix epoch.
|
|
25
|
+
*/
|
|
12
26
|
loadedAt = Date.now();
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new instance of the plugin.
|
|
29
|
+
*/
|
|
13
30
|
constructor(options) {
|
|
14
31
|
this.options = options;
|
|
15
32
|
}
|
|
@@ -22,6 +39,11 @@ var PluginCommon = class {
|
|
|
22
39
|
*/
|
|
23
40
|
async deactivate(ctx) {}
|
|
24
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Whether the given object is a CommandKit plugin.
|
|
44
|
+
* @param plugin The object to check.
|
|
45
|
+
* @returns Boolean indicating whether the object is a plugin.
|
|
46
|
+
*/
|
|
25
47
|
function isPlugin(plugin) {
|
|
26
48
|
return plugin instanceof PluginCommon;
|
|
27
49
|
}
|
|
@@ -45,4 +67,4 @@ Object.defineProperty(exports, 'isPlugin', {
|
|
|
45
67
|
return isPlugin;
|
|
46
68
|
}
|
|
47
69
|
});
|
|
48
|
-
//# sourceMappingURL=PluginCommon-
|
|
70
|
+
//# sourceMappingURL=PluginCommon-D_Z8Oiic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginCommon-D_Z8Oiic.js","names":[],"sources":["../src/plugins/PluginCommon.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { CommonPluginRuntime } from './plugin-runtime/runtime';\n\n/**\n * The options for a CommandKit plugin.\n */\nexport type PluginOptions = Record<string, any>;\n\n/**\n * Enum representing the type of plugin.\n * - Compiler: A plugin that runs at compile time.\n * - Runtime: A plugin that runs at runtime.\n */\nexport enum PluginType {\n Compiler = 'compiler',\n Runtime = 'runtime',\n}\n\n/**\n * Base class for CommandKit plugins.\n */\nexport abstract class PluginCommon<\n T extends PluginOptions = PluginOptions,\n C extends CommonPluginRuntime = CommonPluginRuntime,\n> {\n /**\n * The type of the plugin, either Compiler or Runtime.\n */\n public abstract readonly type: PluginType;\n /**\n * Unique identifier for the plugin instance.\n */\n public readonly id = randomUUID();\n /**\n * The time when the plugin was loaded, in milliseconds since the Unix epoch.\n */\n public readonly loadedAt = Date.now();\n /**\n * The name of the plugin.\n */\n public abstract readonly name: string;\n\n /**\n * Creates a new instance of the plugin.\n */\n public constructor(protected readonly options: T) {}\n\n /**\n * Called when this plugin is activated\n */\n public async activate(ctx: C): Promise<void> {}\n\n /**\n * Called when this plugin is deactivated\n */\n public async deactivate(ctx: C): Promise<void> {}\n}\n\n/**\n * Whether the given object is a CommandKit plugin.\n * @param plugin The object to check.\n * @returns Boolean indicating whether the object is a plugin.\n */\nexport function isPlugin(\n plugin: unknown,\n): plugin is PluginCommon<PluginOptions> {\n return plugin instanceof PluginCommon;\n}\n"],"mappings":";;;;;;;;;AAaA,IAAY,oDAAL;AACL;AACA;;AACF;;;;AAKA,IAAsB,eAAtB,MAGA;;;;CAQE,AAAgB,KAAK,6BAAY;;;;CAIjC,AAAgB,WAAW,KAAK,KAAK;;;;CASrC,AAAO,YAA+B,SAAY;EAAZ;CAAa;;;;CAKnD,MAAa,SAAS,KAAuB,CAAC;;;;CAK9C,MAAa,WAAW,KAAuB,CAAC;AAClD;;;;;;AAOA,SAAgB,SAChB,QACwC;AACtC,QAAO,kBAAkB;AAC3B"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-
|
|
2
|
-
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-
|
|
1
|
+
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
+
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DOCvOVC4.js";
|
|
3
3
|
import { RoleSelectMenuBuilder, RoleSelectMenuInteraction } from "discord.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/v1/select-menu/RoleSelectMenuKit.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Type for the handler function that is called when the role select menu is submitted.
|
|
9
|
+
*/
|
|
6
10
|
type OnRoleSelectMenuKitSubmit = OnSelectMenuKitSubmit<RoleSelectMenuInteraction, RoleSelectMenuKit>;
|
|
11
|
+
/**
|
|
12
|
+
* Type for the predicate function that filters role select menu interactions.
|
|
13
|
+
* It receives a RoleSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
+
*/
|
|
7
15
|
type RoleSelectMenuKitPredicate = SelectMenuKitPredicate<RoleSelectMenuInteraction>;
|
|
16
|
+
/**
|
|
17
|
+
* A builder for creating role select menus with additional features like interaction collectors and event handling.
|
|
18
|
+
* This class extends the RoleSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
+
* It allows you to set a handler for when the role select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
+
*/
|
|
8
21
|
declare class RoleSelectMenuKit extends RoleSelectMenuBuilder {
|
|
9
22
|
#private;
|
|
10
23
|
/**
|
|
@@ -44,8 +57,11 @@ declare class RoleSelectMenuKit extends RoleSelectMenuBuilder {
|
|
|
44
57
|
*/
|
|
45
58
|
filter(predicate: SelectMenuKitPredicate<RoleSelectMenuInteraction>): this;
|
|
46
59
|
private get customId();
|
|
60
|
+
/**
|
|
61
|
+
* Disposes of the role select menu kit, cleaning up any resources and event listeners.
|
|
62
|
+
*/
|
|
47
63
|
dispose(): this;
|
|
48
64
|
}
|
|
49
65
|
//#endregion
|
|
50
66
|
export { OnRoleSelectMenuKitSubmit, RoleSelectMenuKit, RoleSelectMenuKitPredicate };
|
|
51
|
-
//# sourceMappingURL=RoleSelectMenuKit-
|
|
67
|
+
//# sourceMappingURL=RoleSelectMenuKit-C26lU3sN.d.ts.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
const require_PluginCommon = require('./PluginCommon-
|
|
1
|
+
const require_PluginCommon = require('./PluginCommon-D_Z8Oiic.js');
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/RuntimePlugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* CommandKit plugin that runs at the runtime.
|
|
6
|
+
*/
|
|
4
7
|
var RuntimePlugin = class extends require_PluginCommon.PluginCommon {
|
|
5
8
|
type = require_PluginCommon.PluginType.Runtime;
|
|
6
9
|
/**
|
|
@@ -127,4 +130,4 @@ Object.defineProperty(exports, 'isRuntimePlugin', {
|
|
|
127
130
|
return isRuntimePlugin;
|
|
128
131
|
}
|
|
129
132
|
});
|
|
130
|
-
//# sourceMappingURL=RuntimePlugin-
|
|
133
|
+
//# sourceMappingURL=RuntimePlugin-CehKbceZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuntimePlugin-CehKbceZ.js","names":[],"sources":["../src/plugins/RuntimePlugin.ts"],"sourcesContent":["import { Interaction, Message } from 'discord.js';\nimport {\n isPlugin,\n PluginCommon,\n PluginOptions,\n PluginType,\n} from './PluginCommon';\nimport type { CommandKitPluginRuntime } from './plugin-runtime/CommandKitPluginRuntime';\nimport { CommandBuilderLike, PreparedAppCommandExecution } from '../app';\nimport { CommandKitEnvironment } from '../context/environment';\nimport { CommandKitHMREvent } from '../utils/dev-hooks';\nimport { PreRegisterCommandsEvent } from '../app/register/CommandRegistrar';\nimport { CommandKitEventDispatch } from './types';\n\n/**\n * CommandKit plugin that runs at the runtime.\n */\nexport abstract class RuntimePlugin<\n T extends PluginOptions = PluginOptions,\n> extends PluginCommon<T, CommandKitPluginRuntime> {\n public readonly type = PluginType.Runtime;\n /**\n * Called before commands are loaded\n */\n public async onBeforeCommandsLoad(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called after commands are loaded\n */\n public async onAfterCommandsLoad(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called before events are loaded\n */\n public async onBeforeEventsLoad(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called after events are loaded\n */\n public async onAfterEventsLoad(ctx: CommandKitPluginRuntime): Promise<void> {}\n\n /**\n * Called before the client logs in\n */\n public async onBeforeClientLogin(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called after the client logs in\n */\n public async onAfterClientLogin(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called before interaction is handled\n * @param interaction The interaction\n */\n public async onBeforeInteraction(\n ctx: CommandKitPluginRuntime,\n interaction: Interaction,\n ): Promise<void> {}\n\n /**\n * Called before message command is processed\n * @param message The message\n */\n public async onBeforeMessageCommand(\n ctx: CommandKitPluginRuntime,\n message: Message,\n ): Promise<void> {}\n\n /**\n * Called before command is executed. This method can execute the command itself.\n * @param source The source that triggered the command\n * @param command The command\n * @param execute The function that executes the command\n */\n public async executeCommand(\n ctx: CommandKitPluginRuntime,\n env: CommandKitEnvironment,\n source: Interaction | Message,\n command: PreparedAppCommandExecution,\n execute: () => Promise<any>,\n ): Promise<boolean> {\n return false;\n }\n\n /**\n * Called after events router is initialized\n * @param ctx The context\n */\n public async onEventsRouterInit(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called after commands router is initialized\n * @param ctx The context\n */\n public async onCommandsRouterInit(\n ctx: CommandKitPluginRuntime,\n ): Promise<void> {}\n\n /**\n * Called when HMR event is received\n * @param ctx The context\n * @param event The event\n */\n public async performHMR(\n ctx: CommandKitPluginRuntime,\n event: CommandKitHMREvent,\n ): Promise<void> {}\n\n /**\n * Called before command is loaded for registration. This method can be used to modify the command data before it is loaded.\n * @param ctx The context\n * @param commands The command that is being loaded. This is a CommandBuilderLike object which represents Discord's command\n */\n async prepareCommand(\n ctx: CommandKitPluginRuntime,\n commands: CommandBuilderLike,\n ): Promise<CommandBuilderLike | null> {\n return null;\n }\n\n /**\n * Called before command is registered to discord. This method can cancel the registration of the command and handle it manually.\n * @param ctx The context\n * @param data The command registration data\n */\n async onBeforeRegisterCommands(\n ctx: CommandKitPluginRuntime,\n event: PreRegisterCommandsEvent,\n ): Promise<void> {}\n\n /**\n * Called before global commands registration. This method can cancel the registration of the command and handle it manually.\n * This method is called after `onBeforeRegisterCommands` if that stage was not handled.\n * @param ctx The context\n * @param event The command registration data\n */\n async onBeforeRegisterGlobalCommands(\n ctx: CommandKitPluginRuntime,\n event: PreRegisterCommandsEvent,\n ): Promise<void> {}\n\n /**\n * Called before guild commands registration. This method can cancel the registration of the command and handle it manually.\n * This method is called before guilds of the command are resolved. It is called after `onBeforeRegisterCommands` if that stage was not handled.\n * @param ctx The context\n * @param event The command registration data\n */\n async onBeforePrepareGuildCommandsRegistration(\n ctx: CommandKitPluginRuntime,\n event: PreRegisterCommandsEvent,\n ): Promise<void> {}\n\n /**\n * Called before guild commands registration. This method can cancel the registration of the command and handle it manually.\n * This method is called after guilds of the command are resolved. It is called after `onBeforePrepareGuildCommandsRegistration` if that stage was not handled.\n * @param ctx The context\n * @param event The command registration data\n */\n async onBeforeRegisterGuildCommands(\n ctx: CommandKitPluginRuntime,\n event: PreRegisterCommandsEvent,\n ): Promise<void> {}\n\n /**\n * Called after command and all of its deferred functions are executed.\n * @param ctx The context\n * @param env The environment of the command. This environment contains the command execution data such as command context and more.\n */\n async onAfterCommand(\n ctx: CommandKitPluginRuntime,\n env: CommandKitEnvironment,\n ) {}\n\n /**\n * Called before emitting an event\n * @param ctx The context\n * @param event The event that is being emitted\n */\n public async willEmitEvent(\n ctx: CommandKitPluginRuntime,\n event: CommandKitEventDispatch,\n ) {}\n}\n\nexport function isRuntimePlugin(plugin: unknown): plugin is RuntimePlugin {\n return (\n plugin instanceof RuntimePlugin ||\n (isPlugin(plugin) && plugin.type === PluginType.Runtime)\n );\n}\n"],"mappings":";;;;;;AAiBA,IAAsB,gBAAtB,cAEA,kCAAyC;CACvC,AAAgB,OAAO,gCAAW;;;;CAIlC,MAAa,qBACb,KACgB,CAAE;;;;CAKlB,MAAa,oBACb,KACgB,CAAE;;;;CAKlB,MAAa,mBACb,KACgB,CAAE;;;;CAKlB,MAAa,kBAAkB,KAA6C,CAAC;;;;CAK7E,MAAa,oBACb,KACgB,CAAE;;;;CAKlB,MAAa,mBACb,KACgB,CAAE;;;;;CAMlB,MAAa,oBACb,KACA,aACgB,CAAE;;;;;CAMlB,MAAa,uBACb,KACA,SACgB,CAAE;;;;;;;CAQlB,MAAa,eACb,KACA,KACA,QACA,SACA,SACmB;AACjB,SAAO;CACT;;;;;CAMA,MAAa,mBACb,KACgB,CAAE;;;;;CAMlB,MAAa,qBACb,KACgB,CAAE;;;;;;CAOlB,MAAa,WACb,KACA,OACgB,CAAE;;;;;;CAOlB,MAAM,eACN,KACA,UACqC;AACnC,SAAO;CACT;;;;;;CAOA,MAAM,yBACN,KACA,OACgB,CAAE;;;;;;;CAQlB,MAAM,+BACN,KACA,OACgB,CAAE;;;;;;;CAQlB,MAAM,yCACN,KACA,OACgB,CAAE;;;;;;;CAQlB,MAAM,8BACN,KACA,OACgB,CAAE;;;;;;CAOlB,MAAM,eACN,KACA,KACA,CAAE;;;;;;CAOF,MAAa,cACb,KACA,OACA,CAAE;AACJ;AAEA,SAAgB,gBAAgB,QAA0C;AACxE,QACE,kBAAkB,iBAClB,8BAAS,OAAO,IAAI,OAAO,SAAS,gCAAW;AAEnD"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { MaybeArray } from "./types-CJ-XvOFN.js";
|
|
2
|
+
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd } from "./common-DOCvOVC4.js";
|
|
3
|
+
import { StringSelectMenuKit } from "./StringSelectMenuKit-Bhs8U6WI.js";
|
|
4
|
+
import { ChannelSelectMenuKit } from "./ChannelSelectMenuKit-BrXvBYNH.js";
|
|
5
|
+
import { MentionableSelectMenuKit } from "./MentionableSelectMenuKit-CPTKqx-O.js";
|
|
6
|
+
import { UserSelectMenuKit } from "./UserSelectMenuKit-CfqFJdxz.js";
|
|
7
|
+
import { RoleSelectMenuKit } from "./RoleSelectMenuKit-C26lU3sN.js";
|
|
8
|
+
import { APISelectMenuOption, BaseSelectMenuComponentData, ChannelSelectMenuComponentData, ChannelSelectMenuInteraction, MentionableSelectMenuComponentData, MentionableSelectMenuInteraction, RoleSelectMenuComponentData, RoleSelectMenuInteraction, SelectMenuComponentOptionData, StringSelectMenuInteraction, StringSelectMenuOptionBuilder, UserSelectMenuComponentData, UserSelectMenuInteraction } from "discord.js";
|
|
9
|
+
|
|
10
|
+
//#region src/components/v1/select-menu/SelectMenu.d.ts
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Type for the common properties shared by all select menu builders.
|
|
14
|
+
*/
|
|
15
|
+
interface CommonSelectMenuProps<T, C> {
|
|
16
|
+
onSelect?: CommandKitSelectMenuBuilderInteractionCollectorDispatch<T, C>;
|
|
17
|
+
onEnd?: CommandKitSelectMenuBuilderOnEnd;
|
|
18
|
+
onError?: (error: Error) => any;
|
|
19
|
+
options?: CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Type for the base select menu component data.
|
|
23
|
+
*/
|
|
24
|
+
interface SelectMenuProps<T, C> extends Partial<Omit<BaseSelectMenuComponentData, 'type'>>, CommonSelectMenuProps<T, C> {}
|
|
25
|
+
/**
|
|
26
|
+
* The properties for a string select menu component.
|
|
27
|
+
*/
|
|
28
|
+
interface StringSelectMenuProps extends SelectMenuProps<StringSelectMenuInteraction, StringSelectMenuKit> {
|
|
29
|
+
children?: MaybeArray<StringSelectMenuOptionBuilder>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Type for the common builder kit that can be used with select menus.
|
|
33
|
+
*/
|
|
34
|
+
type CommonBuilderKit = StringSelectMenuKit | UserSelectMenuKit | RoleSelectMenuKit | ChannelSelectMenuKit | MentionableSelectMenuKit;
|
|
35
|
+
/**
|
|
36
|
+
* Type that resolves to the specific interaction type based on the builder type.
|
|
37
|
+
* This is used to ensure that the interaction type matches the builder type.
|
|
38
|
+
* For example, if the builder is a StringSelectMenuKit, the interaction type will be StringSelectMenuInteraction.
|
|
39
|
+
* If the builder is a UserSelectMenuKit, the interaction type will be UserSelectMenuInteraction, and so on.
|
|
40
|
+
*/
|
|
41
|
+
type ResolveBuilderInteraction<T> = T extends StringSelectMenuKit ? StringSelectMenuInteraction : T extends UserSelectMenuKit ? UserSelectMenuInteraction : T extends RoleSelectMenuKit ? RoleSelectMenuInteraction : T extends ChannelSelectMenuKit ? ChannelSelectMenuInteraction : T extends MentionableSelectMenuKit ? MentionableSelectMenuInteraction : never;
|
|
42
|
+
/**
|
|
43
|
+
* The StringSelectMenu component.
|
|
44
|
+
* @param props The properties for the string select menu component.
|
|
45
|
+
* @returns The string select menu builder instance.
|
|
46
|
+
* @example ```tsx
|
|
47
|
+
* import { StringSelectMenu } from 'commandkit';
|
|
48
|
+
*
|
|
49
|
+
* const stringSelectMenu = <StringSelectMenu
|
|
50
|
+
* customId="my-select-menu"
|
|
51
|
+
* placeholder="Select an option"
|
|
52
|
+
* maxValues={1}
|
|
53
|
+
* minValues={1}
|
|
54
|
+
* >
|
|
55
|
+
* <StringSelectMenuOption label="Option 1" value="option1" />
|
|
56
|
+
* <StringSelectMenuOption label="Option 2" value="option2" />
|
|
57
|
+
* </StringSelectMenu>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function StringSelectMenu(props: StringSelectMenuProps): StringSelectMenuKit;
|
|
61
|
+
/**
|
|
62
|
+
* Represents the properties for a string select menu option.
|
|
63
|
+
* This can be either a SelectMenuComponentOptionData or an APISelectMenuOption.
|
|
64
|
+
*/
|
|
65
|
+
type StringSelectMenuOptionProps = SelectMenuComponentOptionData | APISelectMenuOption;
|
|
66
|
+
/**
|
|
67
|
+
* A select menu option for the string select menu.
|
|
68
|
+
* @param props The properties for the string select menu option.
|
|
69
|
+
* @returns The string select menu option builder instance.
|
|
70
|
+
* @example ```tsx
|
|
71
|
+
* import { StringSelectMenuOption } from 'commandkit';
|
|
72
|
+
*
|
|
73
|
+
* const option = <StringSelectMenuOption label="Option 1" value="option1" />;
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare function StringSelectMenuOption(props: StringSelectMenuOptionProps): StringSelectMenuOptionBuilder;
|
|
77
|
+
/**
|
|
78
|
+
* The UserSelectMenu component.
|
|
79
|
+
*/
|
|
80
|
+
interface UserSelectMenuProps extends Partial<Omit<UserSelectMenuComponentData, 'type'>>, CommonSelectMenuProps<UserSelectMenuInteraction, UserSelectMenuKit> {}
|
|
81
|
+
/**
|
|
82
|
+
* The UserSelectMenu component.
|
|
83
|
+
* @param props The properties for the user select menu component.
|
|
84
|
+
* @returns The user select menu builder instance.
|
|
85
|
+
* @example ```tsx
|
|
86
|
+
* import { UserSelectMenu } from 'commandkit';
|
|
87
|
+
*
|
|
88
|
+
* const userSelectMenu = <UserSelectMenu />
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function UserSelectMenu(props: UserSelectMenuProps): UserSelectMenuKit;
|
|
92
|
+
/**
|
|
93
|
+
* The RoleSelectMenu component props.
|
|
94
|
+
*/
|
|
95
|
+
interface RoleSelectMenuProps extends Partial<Omit<RoleSelectMenuComponentData, 'type'>>, CommonSelectMenuProps<RoleSelectMenuInteraction, RoleSelectMenuKit> {}
|
|
96
|
+
/**
|
|
97
|
+
* The RoleSelectMenu component.
|
|
98
|
+
* @param props The properties for the role select menu component.
|
|
99
|
+
* @returns The role select menu builder instance.
|
|
100
|
+
* @example ```tsx
|
|
101
|
+
* import { RoleSelectMenu } from 'commandkit';
|
|
102
|
+
*
|
|
103
|
+
* const roleSelectMenu = <RoleSelectMenu />
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
declare function RoleSelectMenu(props: RoleSelectMenuProps): RoleSelectMenuKit;
|
|
107
|
+
/**
|
|
108
|
+
* The MentionableSelectMenu component props.
|
|
109
|
+
*/
|
|
110
|
+
interface MentionableSelectMenuProps extends Partial<Omit<MentionableSelectMenuComponentData, 'type'>>, CommonSelectMenuProps<MentionableSelectMenuInteraction, MentionableSelectMenuKit> {}
|
|
111
|
+
/**
|
|
112
|
+
* The MentionableSelectMenu component.
|
|
113
|
+
* @param props The properties for the mentionable select menu component.
|
|
114
|
+
* @returns The mentionable select menu builder instance.
|
|
115
|
+
* @example ```tsx
|
|
116
|
+
* import { MentionableSelectMenu } from 'commandkit';
|
|
117
|
+
* const mentionableSelectMenu = <MentionableSelectMenu />
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare function MentionableSelectMenu(props: MentionableSelectMenuProps): MentionableSelectMenuKit;
|
|
121
|
+
/**
|
|
122
|
+
* The ChannelSelectMenu component props.
|
|
123
|
+
*/
|
|
124
|
+
interface ChannelSelectMenuProps extends Partial<Omit<ChannelSelectMenuComponentData, 'type'>>, CommonSelectMenuProps<ChannelSelectMenuInteraction, ChannelSelectMenuKit> {}
|
|
125
|
+
/**
|
|
126
|
+
* The ChannelSelectMenu component.
|
|
127
|
+
* @param props The properties for the channel select menu component.
|
|
128
|
+
* @returns The channel select menu builder instance.
|
|
129
|
+
* @example ```tsx
|
|
130
|
+
* import { ChannelSelectMenu } from 'commandkit';
|
|
131
|
+
* const channelSelectMenu = <ChannelSelectMenu />
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
declare function ChannelSelectMenu(props: ChannelSelectMenuProps): ChannelSelectMenuKit;
|
|
135
|
+
//#endregion
|
|
136
|
+
export { ChannelSelectMenu, ChannelSelectMenuProps, CommonBuilderKit, CommonSelectMenuProps, MentionableSelectMenu, MentionableSelectMenuProps, ResolveBuilderInteraction, RoleSelectMenu, RoleSelectMenuProps, SelectMenuProps, StringSelectMenu, StringSelectMenuOption, StringSelectMenuOptionProps, StringSelectMenuProps, UserSelectMenu, UserSelectMenuProps };
|
|
137
|
+
//# sourceMappingURL=SelectMenu-Diy87_ba.d.ts.map
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-
|
|
2
|
-
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-
|
|
1
|
+
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
+
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DOCvOVC4.js";
|
|
3
3
|
import { StringSelectMenuBuilder, StringSelectMenuInteraction } from "discord.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/v1/select-menu/StringSelectMenuKit.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Type for the handler function that is called when the string select menu is submitted.
|
|
9
|
+
*/
|
|
6
10
|
type OnStringSelectMenuKitSubmit = OnSelectMenuKitSubmit<StringSelectMenuInteraction, StringSelectMenuKit>;
|
|
11
|
+
/**
|
|
12
|
+
* Type for the predicate function that filters string select menu interactions.
|
|
13
|
+
* It receives a StringSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
+
*/
|
|
7
15
|
type StringSelectMenuKitPredicate = SelectMenuKitPredicate<StringSelectMenuInteraction>;
|
|
16
|
+
/**
|
|
17
|
+
* A builder for creating string select menus with additional features like interaction collectors and event handling.
|
|
18
|
+
* This class extends the StringSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
+
* It allows you to set a handler for when the string select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
+
*/
|
|
8
21
|
declare class StringSelectMenuKit extends StringSelectMenuBuilder {
|
|
9
22
|
#private;
|
|
10
23
|
/**
|
|
@@ -44,8 +57,11 @@ declare class StringSelectMenuKit extends StringSelectMenuBuilder {
|
|
|
44
57
|
*/
|
|
45
58
|
filter(predicate: SelectMenuKitPredicate<StringSelectMenuInteraction>): this;
|
|
46
59
|
private get customId();
|
|
60
|
+
/**
|
|
61
|
+
* Disposes of the interaction collector and cleans up resources.
|
|
62
|
+
*/
|
|
47
63
|
dispose(): this;
|
|
48
64
|
}
|
|
49
65
|
//#endregion
|
|
50
66
|
export { OnStringSelectMenuKitSubmit, StringSelectMenuKit, StringSelectMenuKitPredicate };
|
|
51
|
-
//# sourceMappingURL=StringSelectMenuKit-
|
|
67
|
+
//# sourceMappingURL=StringSelectMenuKit-Bhs8U6WI.d.ts.map
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-
|
|
2
|
-
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-
|
|
1
|
+
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
+
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DOCvOVC4.js";
|
|
3
3
|
import { UserSelectMenuBuilder, UserSelectMenuInteraction } from "discord.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/v1/select-menu/UserSelectMenuKit.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Type for the handler function that is called when the user select menu is submitted.
|
|
9
|
+
*/
|
|
6
10
|
type OnUserSelectMenuKitSubmit = OnSelectMenuKitSubmit<UserSelectMenuInteraction, UserSelectMenuKit>;
|
|
11
|
+
/**
|
|
12
|
+
* Type for the predicate function that filters user select menu interactions.
|
|
13
|
+
* It receives a UserSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
+
*/
|
|
7
15
|
type UserSelectMenuKitPredicate = SelectMenuKitPredicate<UserSelectMenuInteraction>;
|
|
16
|
+
/**
|
|
17
|
+
* A builder for creating user select menus with additional features like interaction collectors and event handling.
|
|
18
|
+
* This class extends the UserSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
+
* It allows you to set a handler for when the user select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
+
*/
|
|
8
21
|
declare class UserSelectMenuKit extends UserSelectMenuBuilder {
|
|
9
22
|
#private;
|
|
10
23
|
/**
|
|
@@ -44,8 +57,11 @@ declare class UserSelectMenuKit extends UserSelectMenuBuilder {
|
|
|
44
57
|
*/
|
|
45
58
|
filter(predicate: SelectMenuKitPredicate<UserSelectMenuInteraction>): this;
|
|
46
59
|
private get customId();
|
|
60
|
+
/**
|
|
61
|
+
* Disposes of the user select menu kit, cleaning up any collectors and handlers.
|
|
62
|
+
*/
|
|
47
63
|
dispose(): this;
|
|
48
64
|
}
|
|
49
65
|
//#endregion
|
|
50
66
|
export { OnUserSelectMenuKitSubmit, UserSelectMenuKit, UserSelectMenuKitPredicate };
|
|
51
|
-
//# sourceMappingURL=UserSelectMenuKit-
|
|
67
|
+
//# sourceMappingURL=UserSelectMenuKit-CfqFJdxz.d.ts.map
|