commandkit 1.2.0-rc.11 → 1.2.0-rc.13
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/{COPYING.md → LICENSE.md} +3 -3
- package/README.md +3 -3
- package/bin/index.mjs +1 -1
- package/cli.d.ts +19 -0
- package/config.cjs +3 -0
- package/config.d.ts +1 -0
- package/dist/{ActionRow-DKnFVDME.d.ts → ActionRow-B-CGmjDp.d.ts} +4 -5
- package/dist/{ActionRow-CbdGFWMT.js → ActionRow-CSN_UKmM.js} +3 -4
- package/dist/ActionRow-CSN_UKmM.js.map +1 -0
- package/dist/{Button-4ZUXdA56.d.ts → Button-C-GPeFA3.d.ts} +7 -8
- package/dist/{ButtonKit-C7r7RPNf.d.ts → ButtonKit-DKu0VAe4.d.ts} +37 -38
- package/dist/ChannelSelectMenuKit-HQZ4hH5s.d.ts +66 -0
- package/dist/{CommandKitEventsChannel-BtRzr3Tz.js → CommandKitEventsChannel-CnT5ymYe.js} +2 -2
- package/dist/{CommandKitEventsChannel-BtRzr3Tz.js.map → CommandKitEventsChannel-CnT5ymYe.js.map} +1 -1
- package/dist/{CommandsRouter-CoOA7hkf.d.ts → CommandsRouter-C7dZEepB.d.ts} +49 -50
- package/dist/{CommandsRouter-Dmzw-ikm.js → CommandsRouter-C_HLsrGX.js} +2 -6
- package/dist/{CommandsRouter-Dmzw-ikm.js.map → CommandsRouter-C_HLsrGX.js.map} +1 -1
- package/dist/{CompilerPlugin-M8r3yNAl.js → CompilerPlugin-CUsGAfgl.js} +2 -2
- package/dist/{CompilerPlugin-M8r3yNAl.js.map → CompilerPlugin-CUsGAfgl.js.map} +1 -1
- package/dist/{EventInterceptor-CQEXyUTp.js → EventInterceptor-BWoEJMHZ.js} +1 -1
- package/dist/{EventInterceptor-CQEXyUTp.js.map → EventInterceptor-BWoEJMHZ.js.map} +1 -1
- package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-CZmWpS08.d.ts} +40 -40
- package/dist/{EventWorkerContext-Dq29tieI.js → EventWorkerContext-Dfhgv329.js} +2 -3
- package/dist/EventWorkerContext-Dfhgv329.js.map +1 -0
- package/dist/EventsRouter-DZ37r54v.d.ts +90 -0
- package/dist/{EventsRouter-3Gygh-km.js → EventsRouter-DZYIha6m.js} +2 -6
- package/dist/{EventsRouter-3Gygh-km.js.map → EventsRouter-DZYIha6m.js.map} +1 -1
- package/dist/MentionableSelectMenuKit-7URDUM3-.d.ts +61 -0
- package/dist/{MessageCommandParser-Dl0xxtdr.js → MessageCommandParser-Bs9fimmd.js} +53 -55
- package/dist/{MessageCommandParser-Dl0xxtdr.js.map → MessageCommandParser-Bs9fimmd.js.map} +1 -1
- package/dist/MessageCommandParser-q3dQcE5N.d.ts +194 -0
- package/dist/{Modal-C6UTRdYQ.d.ts → Modal-CZT9MZsy.d.ts} +25 -12
- package/dist/{ModalKit-Btz58KYn.d.ts → ModalKit-BWXI3Z26.d.ts} +34 -35
- package/dist/{PluginCommon-Cvl5yYM_.js → PluginCommon-BLxWww5u.js} +6 -7
- package/dist/{PluginCommon-Cvl5yYM_.js.map → PluginCommon-BLxWww5u.js.map} +1 -1
- package/dist/RoleSelectMenuKit-BY-JJ18w.d.ts +66 -0
- package/dist/{RuntimePlugin-BUecuBIU.js → RuntimePlugin-CtobluSU.js} +2 -2
- package/dist/{RuntimePlugin-BUecuBIU.js.map → RuntimePlugin-CtobluSU.js.map} +1 -1
- package/dist/{SelectMenu-Diy87_ba.d.ts → SelectMenu-q_b3Mjv9.d.ts} +10 -11
- package/dist/StringSelectMenuKit-lVhUMc3g.d.ts +66 -0
- package/dist/UserSelectMenuKit-CCj4Fpkr.d.ts +66 -0
- package/dist/analytics/analytics-engine.d.ts +1 -31
- package/dist/analytics/analytics-engine.js +24 -36
- package/dist/analytics/analytics-provider.d.ts +1 -31
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.js +24 -36
- package/dist/{analytics-engine-AaAl3kQM.d.ts → analytics-engine-WQhXmx3H.d.ts} +855 -830
- package/dist/app/commands/AppCommandRunner.d.ts +1 -31
- package/dist/app/commands/AppCommandRunner.js +24 -36
- package/dist/app/commands/Context.d.ts +1 -31
- package/dist/app/commands/Context.js +24 -36
- package/dist/app/commands/MessageCommandParser.d.ts +1 -1
- package/dist/app/commands/MessageCommandParser.js +1 -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 +42 -33
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -31
- package/dist/app/handlers/AppCommandHandler.js +24 -36
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -31
- package/dist/app/handlers/AppEventsHandler.js +24 -36
- package/dist/app/index.d.ts +4 -31
- package/dist/app/index.js +24 -37
- package/dist/app/interrupt/signals.d.ts +1 -1
- package/dist/app/interrupt/signals.js +2 -3
- package/dist/app/middlewares/permissions.d.ts +1 -31
- package/dist/app/middlewares/permissions.js +24 -36
- package/dist/app/register/CommandRegistrar.d.ts +1 -31
- package/dist/app/register/CommandRegistrar.js +24 -36
- package/dist/app/router/CommandsRouter.d.ts +1 -1
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/EventsRouter.d.ts +1 -1
- package/dist/app/router/EventsRouter.js +1 -1
- package/dist/app/router/index.d.ts +2 -3
- package/dist/app/router/index.js +3 -3
- package/dist/{chunk-nOFOJqeH.js → chunk-kSYXY2_d.js} +10 -6
- package/dist/cli/app-process.d.ts +0 -1
- package/dist/cli/app-process.js +62 -7
- package/dist/cli/app-process.js.map +1 -0
- package/dist/cli/build.d.ts +2 -31
- package/dist/cli/build.js +191 -41
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/common.d.ts +1 -31
- package/dist/cli/common.js +4 -4
- package/dist/cli/development.d.ts +18 -1
- package/dist/cli/development.js +43 -48
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.d.ts +4 -0
- package/dist/cli/env.js +1 -1
- package/dist/cli/generators.js +5 -8
- package/dist/cli/generators.js.map +1 -1
- package/dist/cli/information.js +5 -5
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.d.ts +12 -2
- package/dist/cli/init.js +102 -38
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/production.d.ts +0 -1
- package/dist/cli/production.js +38 -49
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.js +5 -5
- package/dist/cli/utils.d.ts +0 -1
- package/dist/cli/utils.js +17 -2
- package/dist/cli/utils.js.map +1 -0
- package/dist/{colors-DL3ucTiT.js → colors-Csc0X4QJ.js} +2 -3
- package/dist/{colors-DL3ucTiT.js.map → colors-Csc0X4QJ.js.map} +1 -1
- package/dist/{commandkit-ZoBBh0Q_.js → commandkit-SIjTLD2R.js} +229 -88
- package/dist/commandkit-SIjTLD2R.js.map +1 -0
- package/dist/commandkit.d.ts +1 -31
- package/dist/commandkit.js +24 -36
- package/dist/{common-vnMIelAE.js → common-CEordwf3.js} +3 -3
- package/dist/common-CEordwf3.js.map +1 -0
- package/dist/{common-CrqwC-sx.js → common-DSRs_mfw.js} +10 -14
- package/dist/{common-CrqwC-sx.js.map → common-DSRs_mfw.js.map} +1 -1
- package/dist/{common-DOCvOVC4.d.ts → common-DnwCYit8.d.ts} +4 -5
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/EventInterceptor.js +1 -1
- package/dist/components/common/element.d.ts +1 -4
- package/dist/components/common/element.js +1 -1
- package/dist/components/common/types.d.ts +1 -1
- package/dist/components/common/types.js +0 -1
- package/dist/components/{v2 → display}/common.d.ts +1 -2
- package/dist/components/display/common.js +3 -0
- package/dist/components/display/container.d.ts +2 -0
- package/dist/components/display/container.js +3 -0
- package/dist/components/display/file.d.ts +2 -0
- package/dist/components/display/file.js +3 -0
- package/dist/components/display/index.d.ts +9 -0
- package/dist/components/display/index.js +22 -0
- package/dist/components/display/label.d.ts +2 -0
- package/dist/components/display/label.js +3 -0
- package/dist/components/display/media-gallery.d.ts +2 -0
- package/dist/components/{v2 → display}/media-gallery.js +1 -2
- package/dist/components/display/poll.d.ts +2 -0
- package/dist/components/display/poll.js +5 -0
- package/dist/components/display/section.d.ts +2 -0
- package/dist/components/display/section.js +4 -0
- package/dist/components/display/separator.d.ts +2 -0
- package/dist/components/display/separator.js +3 -0
- package/dist/components/display/text-display.d.ts +2 -0
- package/dist/components/display/text-display.js +3 -0
- package/dist/components/index.d.ts +23 -24
- package/dist/components/index.js +30 -37
- package/dist/components/interactive/action-row/ActionRow.d.ts +2 -0
- package/dist/components/interactive/action-row/ActionRow.js +3 -0
- package/dist/components/interactive/button/Button.d.ts +2 -0
- package/dist/components/interactive/button/Button.js +26 -0
- package/dist/components/interactive/button/ButtonKit.d.ts +2 -0
- package/dist/components/interactive/button/ButtonKit.js +26 -0
- package/dist/components/interactive/modal/Modal.d.ts +2 -0
- package/dist/components/interactive/modal/Modal.js +30 -0
- package/dist/components/interactive/modal/ModalKit.d.ts +2 -0
- package/dist/components/interactive/modal/ModalKit.js +26 -0
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +26 -0
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +26 -0
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +26 -0
- package/dist/components/interactive/select-menu/SelectMenu.d.ts +2 -0
- package/dist/components/interactive/select-menu/SelectMenu.js +31 -0
- package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/StringSelectMenuKit.js +26 -0
- package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +2 -0
- package/dist/components/interactive/select-menu/UserSelectMenuKit.js +26 -0
- package/dist/components/interactive/select-menu/common.d.ts +2 -0
- package/dist/config/config.d.ts +15 -33
- package/dist/config/config.js +24 -36
- package/dist/config/default.d.ts +1 -31
- package/dist/config/default.js +24 -36
- package/dist/config/loader.d.ts +1 -31
- package/dist/config/loader.js +24 -36
- package/dist/config/types.d.ts +1 -31
- package/dist/config/utils.d.ts +1 -31
- package/dist/config/utils.js +1 -1
- package/dist/constants-BFFK-hfP.js +27 -0
- package/dist/{constants-4oxxvaJA.js.map → constants-BFFK-hfP.js.map} +1 -1
- package/dist/{constants-MKu-Q1jh.d.ts → constants-CuYW0K10.d.ts} +14 -8
- package/dist/{constants-BOOGN85p.js → constants-Cw8VjCVz.js} +2 -3
- package/dist/{constants-BOOGN85p.js.map → constants-Cw8VjCVz.js.map} +1 -1
- package/dist/{constants-B5_Ta7PR.js → constants-CxkFFZ7p.js} +16 -1
- package/dist/constants-CxkFFZ7p.js.map +1 -0
- package/dist/{constants-D8PMA9on.d.ts → constants-EpKcj0dH.d.ts} +2 -2
- package/dist/{container-C6GtfAPW.js → container-DCPljKVH.js} +4 -5
- package/dist/container-DCPljKVH.js.map +1 -0
- package/dist/{container-DHBELeJ3.d.ts → container-DYcb7zGw.d.ts} +3 -4
- package/dist/context/async-context.d.ts +1 -31
- package/dist/context/async-context.js +24 -36
- package/dist/context/environment.d.ts +1 -31
- package/dist/context/environment.js +24 -36
- package/dist/{element-Bak9llw_.js → element-DibzzA5L.js} +1 -1
- package/dist/element-DibzzA5L.js.map +1 -0
- package/dist/{element-CAXu1XtK.d.ts → element-wQo0heGj.d.ts} +4 -5
- package/dist/{env-_68PRRoA.js → env-CmspDhHy.js} +7 -3
- package/dist/env-CmspDhHy.js.map +1 -0
- package/dist/error-codes-Ds0bnPvT.js.map +1 -1
- package/dist/events/CommandKitEventsChannel.d.ts +1 -31
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{file-DVOELoNv.js → file-Ca1kpEtE.js} +3 -4
- package/dist/file-Ca1kpEtE.js.map +1 -0
- package/dist/{file-DTrr-p09.d.ts → file-CrV4lSnl.d.ts} +3 -4
- package/dist/flags/FlagProvider.d.ts +1 -31
- package/dist/flags/feature-flags.d.ts +1 -31
- package/dist/flags/feature-flags.js +165 -40
- package/dist/flags/feature-flags.js.map +1 -0
- package/dist/flags/store.d.ts +1 -31
- package/dist/flags/store.js +1 -1
- package/dist/{helpers-Wg6P5fRQ.d.ts → helpers-AQPLVY35.d.ts} +2 -3
- package/dist/{helpers-Dl8wW6aO.js → helpers-Btx1FSZx.js} +2 -3
- package/dist/{helpers-Dl8wW6aO.js.map → helpers-Btx1FSZx.js.map} +1 -1
- package/dist/index.d.ts +41 -42
- package/dist/index.js +47 -46
- package/dist/index.js.map +1 -1
- package/dist/kv/constants.d.ts +1 -1
- package/dist/kv/constants.js +1 -1
- package/dist/kv/dotprops.js +25 -3
- package/dist/kv/dotprops.js.map +1 -0
- package/dist/kv/kv.d.ts +289 -290
- package/dist/kv/kv.js +14 -18
- package/dist/kv/kv.js.map +1 -1
- package/dist/kv/serde.d.ts +12 -3
- package/dist/kv/serde.js +86 -4
- package/dist/kv/serde.js.map +1 -0
- package/dist/label-37kaNWMH.d.ts +28 -0
- package/dist/label-B6vXvwLM.js +35 -0
- package/dist/label-B6vXvwLM.js.map +1 -0
- package/dist/logger/DefaultLogger.d.ts +66 -3
- package/dist/logger/DefaultLogger.js +24 -36
- package/dist/logger/ILogger.d.ts +64 -2
- package/dist/logger/ILogger.js +0 -1
- package/dist/logger/Logger.d.ts +36 -3
- package/dist/logger/Logger.js +24 -36
- package/dist/logger/NoopLogger.d.ts +36 -37
- package/dist/{media-gallery-BMsXSot3.d.ts → media-gallery-Ci3I4ElH.d.ts} +3 -4
- package/dist/{media-gallery-zDtJ3kxb.js → media-gallery-u3gjX7yD.js} +4 -5
- package/dist/media-gallery-u3gjX7yD.js.map +1 -0
- package/dist/plugins/CompilerPlugin.d.ts +1 -31
- package/dist/plugins/CompilerPlugin.js +1 -2
- package/dist/plugins/PluginCommon.d.ts +1 -31
- package/dist/plugins/PluginCommon.js +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +1 -31
- package/dist/plugins/RuntimePlugin.js +1 -2
- package/dist/plugins/index.d.ts +1 -31
- package/dist/plugins/index.js +26 -36
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -31
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +24 -36
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -31
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +24 -36
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -31
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +24 -36
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -31
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +24 -36
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -31
- package/dist/plugins/plugin-runtime/runtime.js +0 -1
- package/dist/plugins/types.d.ts +1 -31
- package/dist/plugins/types.js +0 -1
- package/dist/poll-CFe8yvoJ.js +100 -0
- package/dist/poll-CFe8yvoJ.js.map +1 -0
- package/dist/poll-Ddtapd6n.d.ts +88 -0
- package/dist/{resolve-file-url-ChIyw-Vf.js → resolve-file-url-CdHqwWs3.js} +2 -2
- package/dist/{resolve-file-url-ChIyw-Vf.js.map → resolve-file-url-CdHqwWs3.js.map} +1 -1
- package/dist/{section-DlvrDoJK.js → section-BC8LF-B2.js} +4 -5
- package/dist/section-BC8LF-B2.js.map +1 -0
- package/dist/{section-Dh_FhPeC.d.ts → section-DkUKULnB.d.ts} +3 -4
- package/dist/{separator-DL6QH5H1.js → separator-BUTiW7uz.js} +3 -4
- package/dist/separator-BUTiW7uz.js.map +1 -0
- package/dist/{separator-CMf6Cyy5.d.ts → separator-CbXsIFCa.d.ts} +3 -4
- package/dist/{signals-ChFMD7mB.js → signals-B8z1wJ6W.js} +2 -2
- package/dist/{signals-ChFMD7mB.js.map → signals-B8z1wJ6W.js.map} +1 -1
- package/dist/{signals-SHg7J1U_.d.ts → signals-BbTgTc0i.d.ts} +2 -2
- package/dist/{store-CM6pWVZh.js → store-D8r_hryO.js} +2 -3
- package/dist/{store-CM6pWVZh.js.map → store-D8r_hryO.js.map} +1 -1
- package/dist/{text-display-DRw3r_lK.d.ts → text-display-D7j39VC-.d.ts} +3 -4
- package/dist/{text-display-DbMumig_.js → text-display-DANahMN3.js} +3 -4
- package/dist/text-display-DANahMN3.js.map +1 -0
- package/dist/{type-checker-ocNSZh0W.js → type-checker-cVd3Hpnh.js} +4 -6
- package/dist/{type-checker-ocNSZh0W.js.map → type-checker-cVd3Hpnh.js.map} +1 -1
- package/dist/{types-CJ-XvOFN.d.ts → types-BywA9d2Z.d.ts} +2 -2
- package/dist/{types-package-BWArjyBF.js → types-package-CsTNfvv2.js} +4 -8
- package/dist/{types-package-BWArjyBF.js.map → types-package-CsTNfvv2.js.map} +1 -1
- package/dist/types.d.ts +1 -31
- package/dist/utils/colors.js +1 -1
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +3 -2
- package/dist/utils/dev-hooks.d.ts +1 -31
- package/dist/utils/dev-hooks.js +24 -36
- package/dist/utils/error-codes.d.ts +54 -2
- package/dist/utils/resolve-file-url.d.ts +11 -2
- package/dist/utils/resolve-file-url.js +1 -1
- package/dist/utils/types-package.js +2 -2
- package/dist/utils/useful-stuff/async-queue.d.ts +21 -21
- package/dist/utils/useful-stuff/async-queue.js +1 -2
- package/dist/utils/useful-stuff/async-queue.js.map +1 -1
- package/dist/utils/useful-stuff/mutex.d.ts +62 -62
- package/dist/utils/useful-stuff/ratelimiter.d.ts +56 -56
- package/dist/utils/useful-stuff/ratelimiter.js +1 -2
- package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
- package/dist/utils/useful-stuff/semaphore.d.ts +82 -82
- package/dist/utils/useful-stuff/semaphore.js +1 -3
- package/dist/utils/useful-stuff/semaphore.js.map +1 -1
- package/dist/utils/utilities.d.ts +113 -2
- package/dist/utils/utilities.js +27 -37
- package/dist/utils/{warn-unstable.d.ts → warning.d.ts} +12 -3
- package/dist/utils/warning.js +5 -0
- package/dist/{utils-KsNof0Xz.js → utils-Br3eenD1.js} +1 -1
- package/dist/{utils-KsNof0Xz.js.map → utils-Br3eenD1.js.map} +1 -1
- package/dist/version.d.ts +8 -2
- package/dist/version.js +12 -2
- package/dist/version.js.map +1 -0
- package/dist/warning-CszH8HeS.js +53 -0
- package/dist/warning-CszH8HeS.js.map +1 -0
- package/hooks.cjs +11 -4
- package/package.json +14 -7
- package/dist/ActionRow-CbdGFWMT.js.map +0 -1
- package/dist/ChannelSelectMenuKit-BrXvBYNH.d.ts +0 -67
- package/dist/DefaultLogger-XCOl5nLd.d.ts +0 -67
- package/dist/EventWorkerContext-Dq29tieI.js.map +0 -1
- package/dist/EventWorkerContext-XNgriym3.d.ts +0 -43
- package/dist/EventsRouter-BacqK6z3.d.ts +0 -90
- package/dist/ILogger-BW8GM-YZ.d.ts +0 -64
- package/dist/Logger-DyfkPk7u.d.ts +0 -37
- package/dist/MentionableSelectMenuKit-CPTKqx-O.d.ts +0 -62
- package/dist/MessageCommandParser-BsGMOTDo.d.ts +0 -195
- package/dist/RoleSelectMenuKit-C26lU3sN.d.ts +0 -67
- package/dist/StringSelectMenuKit-Bhs8U6WI.d.ts +0 -67
- package/dist/UserSelectMenuKit-CfqFJdxz.d.ts +0 -67
- package/dist/app-process-cj2vF12T.js +0 -68
- package/dist/app-process-cj2vF12T.js.map +0 -1
- package/dist/build-B5qTswWF.js +0 -174
- package/dist/build-B5qTswWF.js.map +0 -1
- package/dist/commandkit-ZoBBh0Q_.js.map +0 -1
- package/dist/common-vnMIelAE.js.map +0 -1
- package/dist/components/v1/action-row/ActionRow.d.ts +0 -6
- package/dist/components/v1/action-row/ActionRow.js +0 -3
- package/dist/components/v1/button/Button.d.ts +0 -7
- package/dist/components/v1/button/Button.js +0 -38
- package/dist/components/v1/button/ButtonKit.d.ts +0 -3
- package/dist/components/v1/button/ButtonKit.js +0 -38
- package/dist/components/v1/modal/Modal.d.ts +0 -7
- package/dist/components/v1/modal/Modal.js +0 -41
- package/dist/components/v1/modal/ModalKit.d.ts +0 -3
- package/dist/components/v1/modal/ModalKit.js +0 -38
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/SelectMenu.d.ts +0 -10
- package/dist/components/v1/select-menu/SelectMenu.js +0 -43
- package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +0 -4
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +0 -38
- package/dist/components/v1/select-menu/common.d.ts +0 -3
- package/dist/components/v1/select-menu/common.js +0 -1
- package/dist/components/v2/common.js +0 -3
- package/dist/components/v2/container.d.ts +0 -2
- package/dist/components/v2/container.js +0 -4
- package/dist/components/v2/file.d.ts +0 -2
- package/dist/components/v2/file.js +0 -3
- package/dist/components/v2/index.d.ts +0 -8
- package/dist/components/v2/index.js +0 -17
- package/dist/components/v2/media-gallery.d.ts +0 -2
- package/dist/components/v2/section.d.ts +0 -2
- package/dist/components/v2/section.js +0 -5
- package/dist/components/v2/separator.d.ts +0 -2
- package/dist/components/v2/separator.js +0 -3
- package/dist/components/v2/text-display.d.ts +0 -2
- package/dist/components/v2/text-display.js +0 -3
- package/dist/config-D-JMp2IO.d.ts +0 -16
- package/dist/constants-4oxxvaJA.js +0 -27
- package/dist/constants-B5_Ta7PR.js.map +0 -1
- package/dist/container-C6GtfAPW.js.map +0 -1
- package/dist/dotprops-tnhpnszJ.js +0 -36
- package/dist/dotprops-tnhpnszJ.js.map +0 -1
- package/dist/element-Bak9llw_.js.map +0 -1
- package/dist/env-_68PRRoA.js.map +0 -1
- package/dist/error-codes-B4TyW4Ct.d.ts +0 -54
- package/dist/feature-flags-CKNrjgqg.js +0 -160
- package/dist/feature-flags-CKNrjgqg.js.map +0 -1
- package/dist/file-DVOELoNv.js.map +0 -1
- package/dist/init-DOr-Y3GQ.d.ts +0 -13
- package/dist/init-_7_QDifv.js +0 -95
- package/dist/init-_7_QDifv.js.map +0 -1
- package/dist/media-gallery-zDtJ3kxb.js.map +0 -1
- package/dist/resolve-file-url-yO8bUxok.d.ts +0 -11
- package/dist/section-DlvrDoJK.js.map +0 -1
- package/dist/separator-DL6QH5H1.js.map +0 -1
- package/dist/serde-BYaKrsOV.d.ts +0 -12
- package/dist/serde-Cc8iUa9J.js +0 -97
- package/dist/serde-Cc8iUa9J.js.map +0 -1
- package/dist/text-display-DbMumig_.js.map +0 -1
- package/dist/utilities-DtdPlr4c.d.ts +0 -87
- package/dist/utils/warn-unstable.js +0 -26
- package/dist/utils/warn-unstable.js.map +0 -1
- package/dist/utils-DCSnVAZ6.js +0 -23
- package/dist/utils-DCSnVAZ6.js.map +0 -1
- package/dist/v2-DofkPKHs.js +0 -0
- package/dist/version--Q1nmlBz.js +0 -18
- package/dist/version--Q1nmlBz.js.map +0 -1
- package/dist/version-CtJtBJXI.d.ts +0 -8
- /package/dist/{ILogger-dQ7Y9X1f.js → common-C2jAjX4U.js} +0 -0
- /package/dist/{app-HN1cVg8J.js → components/interactive/select-menu/common.js} +0 -0
- /package/dist/{common-CcfjYnPG.js → display-WDb9wMCv.js} +0 -0
- /package/dist/{index-CUPkUUOR.d.ts → index-BJfko-dP.d.ts} +0 -0
- /package/dist/{index-Dw5cCt-A.d.ts → index-CCggO_hw.d.ts} +0 -0
- /package/dist/{index-E7Wvm5uX.d.ts → index-CLjpoGi1.d.ts} +0 -0
- /package/dist/{router-Dn35v30f.js → router-BvamdzoF.js} +0 -0
- /package/dist/{runtime-DB9CiPfe.js → runtime-Skt5NiOc.js} +0 -0
- /package/dist/{types-CUZOquUl.js → types-Cdh4uaFR.js} +0 -0
- /package/dist/{types-q0Nm882H.js → types-TC4g3w91.js} +0 -0
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
const require_colors = require('./colors-
|
|
1
|
+
const require_chunk = require('./chunk-kSYXY2_d.js');
|
|
2
|
+
const require_colors = require('./colors-Csc0X4QJ.js');
|
|
3
3
|
const require_error_codes = require('./error-codes-Ds0bnPvT.js');
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
4
|
+
const require_warning = require('./warning-CszH8HeS.js');
|
|
5
|
+
const require_common = require('./common-CEordwf3.js');
|
|
6
|
+
const require_element = require('./element-DibzzA5L.js');
|
|
7
|
+
const require_EventInterceptor = require('./EventInterceptor-BWoEJMHZ.js');
|
|
8
|
+
const require_constants = require('./constants-CxkFFZ7p.js');
|
|
9
|
+
const require_CompilerPlugin = require('./CompilerPlugin-CUsGAfgl.js');
|
|
10
|
+
const require_RuntimePlugin = require('./RuntimePlugin-CtobluSU.js');
|
|
11
|
+
const require_resolve_file_url = require('./resolve-file-url-CdHqwWs3.js');
|
|
12
|
+
const require_utils = require('./utils-Br3eenD1.js');
|
|
13
|
+
const require_types_package = require('./types-package-CsTNfvv2.js');
|
|
14
|
+
const require_constants$1 = require('./constants-Cw8VjCVz.js');
|
|
15
|
+
const require_EventWorkerContext = require('./EventWorkerContext-Dfhgv329.js');
|
|
16
|
+
const require_signals = require('./signals-B8z1wJ6W.js');
|
|
17
|
+
const require_helpers = require('./helpers-Btx1FSZx.js');
|
|
18
|
+
const require_MessageCommandParser = require('./MessageCommandParser-Bs9fimmd.js');
|
|
19
|
+
const require_CommandsRouter = require('./CommandsRouter-C_HLsrGX.js');
|
|
20
|
+
const require_EventsRouter = require('./EventsRouter-DZYIha6m.js');
|
|
21
|
+
const require_common$1 = require('./common-DSRs_mfw.js');
|
|
22
|
+
const require_CommandKitEventsChannel = require('./CommandKitEventsChannel-CnT5ymYe.js');
|
|
23
|
+
const require_store = require('./store-D8r_hryO.js');
|
|
22
24
|
let node_events = require("node:events");
|
|
23
25
|
node_events = require_chunk.__toESM(node_events);
|
|
24
26
|
let discord_js = require("discord.js");
|
|
25
|
-
discord_js = require_chunk.__toESM(discord_js);
|
|
26
27
|
let node_async_hooks = require("node:async_hooks");
|
|
27
|
-
node_async_hooks = require_chunk.__toESM(node_async_hooks);
|
|
28
28
|
let node_fs = require("node:fs");
|
|
29
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
30
29
|
let node_path = require("node:path");
|
|
31
|
-
node_path = require_chunk.__toESM(node_path);
|
|
32
30
|
let node_crypto = require("node:crypto");
|
|
33
|
-
node_crypto = require_chunk.__toESM(node_crypto);
|
|
34
31
|
let util = require("util");
|
|
35
|
-
util = require_chunk.__toESM(util);
|
|
36
32
|
|
|
37
33
|
//#region src/context/async-context.ts
|
|
38
34
|
const kCommandWorker = Symbol("commandkitCommandWorker");
|
|
@@ -113,7 +109,7 @@ function useStore() {
|
|
|
113
109
|
}
|
|
114
110
|
|
|
115
111
|
//#endregion
|
|
116
|
-
//#region src/components/
|
|
112
|
+
//#region src/components/interactive/button/ButtonKit.ts
|
|
117
113
|
/**
|
|
118
114
|
* A builder for creating buttons with additional features like interaction collectors and event handling.
|
|
119
115
|
*/
|
|
@@ -208,7 +204,9 @@ var ButtonKit = class extends discord_js.ButtonBuilder {
|
|
|
208
204
|
#setupInteractionCollector() {
|
|
209
205
|
if (this.data.style === discord_js.ButtonStyle.Link || !this.#contextData || !this.#onClickHandler) return;
|
|
210
206
|
if ((this.customId ?? null) === null) throw new TypeError("Cannot setup \"onClick\" handler on a button without a custom id.");
|
|
211
|
-
|
|
207
|
+
const interceptor = this.#getEventInterceptor();
|
|
208
|
+
if (!interceptor) return;
|
|
209
|
+
this.#unsub = interceptor.subscribe(discord_js.Events.InteractionCreate, async (interaction) => {
|
|
212
210
|
var _this$contextData5, _this$unsub;
|
|
213
211
|
if (!interaction.isButton()) return;
|
|
214
212
|
const myCustomId = this.customId ?? null;
|
|
@@ -238,7 +236,7 @@ var ButtonKit = class extends discord_js.ButtonBuilder {
|
|
|
238
236
|
};
|
|
239
237
|
|
|
240
238
|
//#endregion
|
|
241
|
-
//#region src/components/
|
|
239
|
+
//#region src/components/interactive/button/Button.ts
|
|
242
240
|
/**
|
|
243
241
|
* The button component.
|
|
244
242
|
* @param props The button properties.
|
|
@@ -264,7 +262,7 @@ function Button(props) {
|
|
|
264
262
|
}
|
|
265
263
|
|
|
266
264
|
//#endregion
|
|
267
|
-
//#region src/components/
|
|
265
|
+
//#region src/components/interactive/modal/ModalKit.ts
|
|
268
266
|
/**
|
|
269
267
|
* A builder for creating modals with additional features like interaction collectors and event handling.
|
|
270
268
|
* This class extends the ModalBuilder from discord.js and adds methods for handling interactions.
|
|
@@ -389,7 +387,7 @@ var ModalKit = class extends discord_js.ModalBuilder {
|
|
|
389
387
|
};
|
|
390
388
|
|
|
391
389
|
//#endregion
|
|
392
|
-
//#region src/components/
|
|
390
|
+
//#region src/components/interactive/modal/Modal.ts
|
|
393
391
|
/**
|
|
394
392
|
* The modal component.
|
|
395
393
|
* @param props The modal properties.
|
|
@@ -403,11 +401,8 @@ function Modal(props) {
|
|
|
403
401
|
if (props.customId) modal.setCustomId(props.customId);
|
|
404
402
|
if (props.onSubmit) modal.onSubmit(props.onSubmit, props.options);
|
|
405
403
|
if (props.children) {
|
|
406
|
-
const childs =
|
|
407
|
-
|
|
408
|
-
if (c instanceof discord_js.TextInputBuilder) return new discord_js.ActionRowBuilder().addComponents(c);
|
|
409
|
-
}).filter((c) => c != null);
|
|
410
|
-
modal.addComponents(childs);
|
|
404
|
+
const childs = Array.isArray(props.children) ? props.children : [props.children];
|
|
405
|
+
modal.components.push(...childs);
|
|
411
406
|
}
|
|
412
407
|
if (props.onEnd) modal.onEnd(props.onEnd);
|
|
413
408
|
if (props.onError) modal.onError(props.onError);
|
|
@@ -417,12 +412,19 @@ function Modal(props) {
|
|
|
417
412
|
* The text input component.
|
|
418
413
|
* @param props The text input properties.
|
|
419
414
|
* @returns The commandkit element.
|
|
420
|
-
* @example <TextInput customId="input"
|
|
415
|
+
* @example <TextInput customId="input" style={TextInputStyle.Short} />
|
|
421
416
|
*/
|
|
422
417
|
function TextInput(props) {
|
|
423
418
|
const input = new discord_js.TextInputBuilder().setStyle(props.style);
|
|
424
419
|
if (props.customId) input.setCustomId(props.customId);
|
|
425
|
-
if (props.label)
|
|
420
|
+
if (props.label) {
|
|
421
|
+
require_warning.warnDeprecated({
|
|
422
|
+
what: "Property `label`",
|
|
423
|
+
where: "<TextInput />",
|
|
424
|
+
message: "Use the <Label /> component instead."
|
|
425
|
+
});
|
|
426
|
+
input.setLabel(props.label);
|
|
427
|
+
}
|
|
426
428
|
if (props.placeholder) input.setPlaceholder(props.placeholder);
|
|
427
429
|
if (props.maxLength) input.setMaxLength(props.maxLength);
|
|
428
430
|
if (props.minLength) input.setMinLength(props.minLength);
|
|
@@ -454,9 +456,24 @@ function ParagraphInput(props) {
|
|
|
454
456
|
style: discord_js.TextInputStyle.Paragraph
|
|
455
457
|
});
|
|
456
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* The file upload component.
|
|
461
|
+
* @param props The file upload properties.
|
|
462
|
+
* @returns The commandkit element.
|
|
463
|
+
* @example <FileUpload customId="file" />
|
|
464
|
+
*/
|
|
465
|
+
function FileUpload(props) {
|
|
466
|
+
const file = new discord_js.FileUploadBuilder();
|
|
467
|
+
require_common.applyId(props, file);
|
|
468
|
+
if (props.maxValues != null) file.setMaxValues(props.maxValues);
|
|
469
|
+
if (props.minValues != null) file.setMinValues(props.minValues);
|
|
470
|
+
if (props.customId != null) file.setCustomId(props.customId);
|
|
471
|
+
if (props.required != null) file.setRequired(props.required);
|
|
472
|
+
return file;
|
|
473
|
+
}
|
|
457
474
|
|
|
458
475
|
//#endregion
|
|
459
|
-
//#region src/components/
|
|
476
|
+
//#region src/components/interactive/select-menu/StringSelectMenuKit.ts
|
|
460
477
|
/**
|
|
461
478
|
* A builder for creating string select menus with additional features like interaction collectors and event handling.
|
|
462
479
|
* This class extends the StringSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
@@ -581,7 +598,7 @@ var StringSelectMenuKit = class extends discord_js.StringSelectMenuBuilder {
|
|
|
581
598
|
};
|
|
582
599
|
|
|
583
600
|
//#endregion
|
|
584
|
-
//#region src/components/
|
|
601
|
+
//#region src/components/interactive/select-menu/ChannelSelectMenuKit.ts
|
|
585
602
|
/**
|
|
586
603
|
* A builder for creating channel select menus with additional features like interaction collectors and event handling.
|
|
587
604
|
* This class extends the ChannelSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
@@ -706,7 +723,7 @@ var ChannelSelectMenuKit = class extends discord_js.ChannelSelectMenuBuilder {
|
|
|
706
723
|
};
|
|
707
724
|
|
|
708
725
|
//#endregion
|
|
709
|
-
//#region src/components/
|
|
726
|
+
//#region src/components/interactive/select-menu/MentionableSelectMenuKit.ts
|
|
710
727
|
var MentionableSelectMenuKit = class extends discord_js.MentionableSelectMenuBuilder {
|
|
711
728
|
#onSelectHandler = null;
|
|
712
729
|
#contextData = {
|
|
@@ -826,7 +843,7 @@ var MentionableSelectMenuKit = class extends discord_js.MentionableSelectMenuBui
|
|
|
826
843
|
};
|
|
827
844
|
|
|
828
845
|
//#endregion
|
|
829
|
-
//#region src/components/
|
|
846
|
+
//#region src/components/interactive/select-menu/UserSelectMenuKit.ts
|
|
830
847
|
/**
|
|
831
848
|
* A builder for creating user select menus with additional features like interaction collectors and event handling.
|
|
832
849
|
* This class extends the UserSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
@@ -951,7 +968,7 @@ var UserSelectMenuKit = class extends discord_js.UserSelectMenuBuilder {
|
|
|
951
968
|
};
|
|
952
969
|
|
|
953
970
|
//#endregion
|
|
954
|
-
//#region src/components/
|
|
971
|
+
//#region src/components/interactive/select-menu/RoleSelectMenuKit.ts
|
|
955
972
|
/**
|
|
956
973
|
* A builder for creating role select menus with additional features like interaction collectors and event handling.
|
|
957
974
|
* This class extends the RoleSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
@@ -1076,7 +1093,7 @@ var RoleSelectMenuKit = class extends discord_js.RoleSelectMenuBuilder {
|
|
|
1076
1093
|
};
|
|
1077
1094
|
|
|
1078
1095
|
//#endregion
|
|
1079
|
-
//#region src/components/
|
|
1096
|
+
//#region src/components/interactive/select-menu/SelectMenu.ts
|
|
1080
1097
|
/**
|
|
1081
1098
|
* @private
|
|
1082
1099
|
*/
|
|
@@ -1197,13 +1214,13 @@ function ChannelSelectMenu(props) {
|
|
|
1197
1214
|
/**
|
|
1198
1215
|
* Log levels for the logger.
|
|
1199
1216
|
*/
|
|
1200
|
-
var LogLevel = /* @__PURE__ */ function(LogLevel
|
|
1201
|
-
LogLevel
|
|
1202
|
-
LogLevel
|
|
1203
|
-
LogLevel
|
|
1204
|
-
LogLevel
|
|
1205
|
-
LogLevel
|
|
1206
|
-
return LogLevel
|
|
1217
|
+
var LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
1218
|
+
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
1219
|
+
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
1220
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
1221
|
+
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
1222
|
+
LogLevel[LogLevel["DEFAULT"] = 4] = "DEFAULT";
|
|
1223
|
+
return LogLevel;
|
|
1207
1224
|
}(LogLevel || {});
|
|
1208
1225
|
const execHandlerKind = {
|
|
1209
1226
|
autocomplete: "Autocomplete",
|
|
@@ -1250,11 +1267,7 @@ var DefaultLogger = class {
|
|
|
1250
1267
|
this.logger = new console.Console(this.stdout, this.stderr);
|
|
1251
1268
|
}
|
|
1252
1269
|
_formatTime(date) {
|
|
1253
|
-
|
|
1254
|
-
const minutes = date.getMinutes().toString().padStart(2, "0");
|
|
1255
|
-
const seconds = date.getSeconds().toString().padStart(2, "0");
|
|
1256
|
-
const millis = date.getMilliseconds().toString().padStart(3, "0");
|
|
1257
|
-
return `${hours}:${minutes}:${seconds}.${millis}`;
|
|
1270
|
+
return `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}.${date.getMilliseconds().toString().padStart(3, "0")}`;
|
|
1258
1271
|
}
|
|
1259
1272
|
_getContext() {
|
|
1260
1273
|
const ctx = getContext();
|
|
@@ -1420,7 +1433,7 @@ var CommandKitPluginRuntime = class {
|
|
|
1420
1433
|
* @param plugin The plugin to pre-load.
|
|
1421
1434
|
*/
|
|
1422
1435
|
async preload(plugin) {
|
|
1423
|
-
for (const entrypoint of plugin.preload) await import(require_resolve_file_url.toFileURL(`${getCurrentDirectory()}/${entrypoint}`));
|
|
1436
|
+
for (const entrypoint of plugin.preload) await (entrypoint.startsWith("module:") ? import(entrypoint.slice(7)) : import(require_resolve_file_url.toFileURL(`${getCurrentDirectory()}/${entrypoint}`)));
|
|
1424
1437
|
}
|
|
1425
1438
|
/**
|
|
1426
1439
|
* Soft registers a plugin in the runtime.
|
|
@@ -1506,10 +1519,10 @@ var CommandKitPluginRuntime = class {
|
|
|
1506
1519
|
* It can be either 'activate' or 'deactivate'.
|
|
1507
1520
|
* @private
|
|
1508
1521
|
*/
|
|
1509
|
-
var PluginExecutionMode = /* @__PURE__ */ function(PluginExecutionMode
|
|
1510
|
-
PluginExecutionMode
|
|
1511
|
-
PluginExecutionMode
|
|
1512
|
-
return PluginExecutionMode
|
|
1522
|
+
var PluginExecutionMode = /* @__PURE__ */ function(PluginExecutionMode) {
|
|
1523
|
+
PluginExecutionMode["Activate"] = "activate";
|
|
1524
|
+
PluginExecutionMode["Deactivate"] = "deactivate";
|
|
1525
|
+
return PluginExecutionMode;
|
|
1513
1526
|
}(PluginExecutionMode || {});
|
|
1514
1527
|
/**
|
|
1515
1528
|
* CompilerPluginRuntime is a runtime for managing compiler plugins in CommandKit.
|
|
@@ -1522,9 +1535,11 @@ var CompilerPluginRuntime = class {
|
|
|
1522
1535
|
/**
|
|
1523
1536
|
* Creates a new instance of CompilerPluginRuntime.
|
|
1524
1537
|
* @param plugins An array of compiler plugins to be managed by this runtime.
|
|
1538
|
+
* @param isDevMode Whether the build is in development mode.
|
|
1525
1539
|
*/
|
|
1526
|
-
constructor(plugins) {
|
|
1540
|
+
constructor(plugins, isDevMode) {
|
|
1527
1541
|
this.plugins = plugins;
|
|
1542
|
+
this.isDevMode = isDevMode;
|
|
1528
1543
|
this.plugins = this.plugins.filter((p) => !!p && require_CompilerPlugin.isCompilerPlugin(p));
|
|
1529
1544
|
}
|
|
1530
1545
|
/**
|
|
@@ -1685,6 +1700,7 @@ var CommonDirectiveTransformer = class extends require_CompilerPlugin.CompilerPl
|
|
|
1685
1700
|
if (!this.options.enabled) return null;
|
|
1686
1701
|
if (!this.transformer) return null;
|
|
1687
1702
|
if (/\.json$/.test(params.id)) return null;
|
|
1703
|
+
if (!params.code.includes(this.options.directive)) return null;
|
|
1688
1704
|
return {
|
|
1689
1705
|
code: (await this.transformer(params.code.toString(), params.id)).contents,
|
|
1690
1706
|
map: null
|
|
@@ -1718,6 +1734,7 @@ var MacroPlugin = class extends require_CompilerPlugin.CompilerPlugin {
|
|
|
1718
1734
|
async transform(params) {
|
|
1719
1735
|
if (!this.options.enabled) return null;
|
|
1720
1736
|
if (/\.json$/.test(params.id)) return null;
|
|
1737
|
+
if (!params.code.includes("use macro")) return null;
|
|
1721
1738
|
const { contents } = await this.macroTransformer.transform(params.code, params.id);
|
|
1722
1739
|
return {
|
|
1723
1740
|
code: typeof contents === "string" ? contents : new TextDecoder().decode(contents),
|
|
@@ -1830,8 +1847,7 @@ function getSrcDir() {
|
|
|
1830
1847
|
*/
|
|
1831
1848
|
function getCurrentDirectory() {
|
|
1832
1849
|
if (currentDir) return currentDir;
|
|
1833
|
-
|
|
1834
|
-
let root = (0, node_path.join)(require_constants.COMMANDKIT_CWD, src);
|
|
1850
|
+
let root = (0, node_path.join)(require_constants.COMMANDKIT_CWD, getSrcDir());
|
|
1835
1851
|
if (!(0, node_fs.existsSync)(root)) root = require_constants.COMMANDKIT_CWD;
|
|
1836
1852
|
currentDir = root;
|
|
1837
1853
|
return root;
|
|
@@ -1888,8 +1904,7 @@ function debounce(fn, ms) {
|
|
|
1888
1904
|
return new Promise((res) => {
|
|
1889
1905
|
resolve = res;
|
|
1890
1906
|
timer = setTimeout(() => {
|
|
1891
|
-
|
|
1892
|
-
res(result);
|
|
1907
|
+
res(fn(...args));
|
|
1893
1908
|
timer = null;
|
|
1894
1909
|
resolve = null;
|
|
1895
1910
|
}, ms);
|
|
@@ -1944,6 +1959,42 @@ function devOnly(fn) {
|
|
|
1944
1959
|
return f;
|
|
1945
1960
|
}
|
|
1946
1961
|
/**
|
|
1962
|
+
* Creates a function from the given function that runs only in build mode.
|
|
1963
|
+
* @param fn The function to run in build mode.
|
|
1964
|
+
* @returns The function that runs only in build mode.
|
|
1965
|
+
* @example
|
|
1966
|
+
* ```ts
|
|
1967
|
+
* const buildOnlyFn = buildOnly(() => {
|
|
1968
|
+
* console.log('This function runs only in build mode');
|
|
1969
|
+
* });
|
|
1970
|
+
* buildOnlyFn(); // This will log the message only in build mode
|
|
1971
|
+
* ```
|
|
1972
|
+
*/
|
|
1973
|
+
function buildOnly(fn) {
|
|
1974
|
+
const f = (...args) => {
|
|
1975
|
+
if (require_constants.isBuildLikeEnvironment()) return fn(...args);
|
|
1976
|
+
};
|
|
1977
|
+
return f;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Creates a function from the given function that runs only outside of build mode.
|
|
1981
|
+
* @param fn The function to run outside of build mode.
|
|
1982
|
+
* @returns The function that runs only outside of build mode.
|
|
1983
|
+
* @example
|
|
1984
|
+
* ```ts
|
|
1985
|
+
* const noBuildOnlyFn = noBuildOnly(() => {
|
|
1986
|
+
* console.log('This function runs only outside of build mode');
|
|
1987
|
+
* });
|
|
1988
|
+
* noBuildOnlyFn(); // This will log the message only outside of build mode
|
|
1989
|
+
* ```
|
|
1990
|
+
*/
|
|
1991
|
+
function noBuildOnly(fn) {
|
|
1992
|
+
const f = (...args) => {
|
|
1993
|
+
if (!require_constants.isBuildLikeEnvironment()) return fn(...args);
|
|
1994
|
+
};
|
|
1995
|
+
return f;
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1947
1998
|
* Creates a simple proxy object that mirrors the target object.
|
|
1948
1999
|
* @param target The target object to proxy.
|
|
1949
2000
|
* @returns The proxied object.
|
|
@@ -2150,9 +2201,9 @@ var CommandKitEnvironment = class {
|
|
|
2150
2201
|
return Math.abs(this.#data.markEnd - this.#data.markStart);
|
|
2151
2202
|
}
|
|
2152
2203
|
};
|
|
2153
|
-
let CommandKitEnvironmentType = /* @__PURE__ */ function(CommandKitEnvironmentType
|
|
2154
|
-
CommandKitEnvironmentType
|
|
2155
|
-
return CommandKitEnvironmentType
|
|
2204
|
+
let CommandKitEnvironmentType = /* @__PURE__ */ function(CommandKitEnvironmentType) {
|
|
2205
|
+
CommandKitEnvironmentType["CommandHandler"] = "COMMAND_HANDLER";
|
|
2206
|
+
return CommandKitEnvironmentType;
|
|
2156
2207
|
}({});
|
|
2157
2208
|
/**
|
|
2158
2209
|
* Schedules the given function to run after the current command has finished executing.
|
|
@@ -2294,7 +2345,15 @@ var Context = class Context {
|
|
|
2294
2345
|
*/
|
|
2295
2346
|
get commandName() {
|
|
2296
2347
|
if (this.isInteraction()) return this.interaction.commandName;
|
|
2297
|
-
|
|
2348
|
+
const maybeAlias = this.config.messageCommandParser.getCommand();
|
|
2349
|
+
return this.commandkit.commandHandler.resolveMessageCommandName(maybeAlias);
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* Gets the invoked command name (could be an alias for message commands)
|
|
2353
|
+
*/
|
|
2354
|
+
get invokedCommandName() {
|
|
2355
|
+
if (this.isInteraction()) return this.interaction.commandName;
|
|
2356
|
+
return this.config.messageCommandParser.getCommand();
|
|
2298
2357
|
}
|
|
2299
2358
|
/**
|
|
2300
2359
|
* Gets the command options based on the execution mode.
|
|
@@ -2738,7 +2797,10 @@ var CommandRegistrar = class {
|
|
|
2738
2797
|
...json,
|
|
2739
2798
|
type: discord_js.ApplicationCommandType.ChatInput,
|
|
2740
2799
|
description: json.description ?? "No command description set.",
|
|
2741
|
-
__metadata
|
|
2800
|
+
__metadata,
|
|
2801
|
+
__applyId: (id) => {
|
|
2802
|
+
cmd.discordId = id;
|
|
2803
|
+
}
|
|
2742
2804
|
});
|
|
2743
2805
|
if (cmd.data.userContextMenu) {
|
|
2744
2806
|
var _metadata$nameAliases;
|
|
@@ -2749,7 +2811,10 @@ var CommandRegistrar = class {
|
|
|
2749
2811
|
options: void 0,
|
|
2750
2812
|
description_localizations: void 0,
|
|
2751
2813
|
description: void 0,
|
|
2752
|
-
__metadata
|
|
2814
|
+
__metadata,
|
|
2815
|
+
__applyId: (id) => {
|
|
2816
|
+
cmd.discordId = id;
|
|
2817
|
+
}
|
|
2753
2818
|
});
|
|
2754
2819
|
}
|
|
2755
2820
|
if (cmd.data.messageContextMenu) {
|
|
@@ -2761,7 +2826,10 @@ var CommandRegistrar = class {
|
|
|
2761
2826
|
description_localizations: void 0,
|
|
2762
2827
|
description: void 0,
|
|
2763
2828
|
options: void 0,
|
|
2764
|
-
__metadata
|
|
2829
|
+
__metadata,
|
|
2830
|
+
__applyId: (id) => {
|
|
2831
|
+
cmd.discordId = id;
|
|
2832
|
+
}
|
|
2765
2833
|
});
|
|
2766
2834
|
}
|
|
2767
2835
|
return collections;
|
|
@@ -2821,8 +2889,16 @@ var CommandRegistrar = class {
|
|
|
2821
2889
|
try {
|
|
2822
2890
|
const data = await this.api.put(discord_js.Routes.applicationCommands(this.commandkit.client.user.id), { body: commands.map((c) => ({
|
|
2823
2891
|
...c,
|
|
2824
|
-
__metadata: void 0
|
|
2892
|
+
__metadata: void 0,
|
|
2893
|
+
__applyId: void 0
|
|
2825
2894
|
})) });
|
|
2895
|
+
data.forEach((c) => {
|
|
2896
|
+
var _cmd$__applyId;
|
|
2897
|
+
if (!c.id) return;
|
|
2898
|
+
const cmd = commands.find((co) => co.name === c.name && co.type === c.type);
|
|
2899
|
+
if (!cmd) return;
|
|
2900
|
+
(_cmd$__applyId = cmd.__applyId) === null || _cmd$__applyId === void 0 || _cmd$__applyId.call(cmd, c.id);
|
|
2901
|
+
});
|
|
2826
2902
|
Logger.info(`✨ Refreshed ${data.length} global application (/) commands`);
|
|
2827
2903
|
} catch (e) {
|
|
2828
2904
|
Logger.error`Failed to update global application (/) commands: ${e}`;
|
|
@@ -2872,8 +2948,16 @@ var CommandRegistrar = class {
|
|
|
2872
2948
|
if (prevented$1) continue;
|
|
2873
2949
|
const data = await this.api.put(discord_js.Routes.applicationGuildCommands(this.commandkit.client.user.id, guild), { body: guildCommands.map((b) => ({
|
|
2874
2950
|
...b,
|
|
2875
|
-
__metadata: void 0
|
|
2951
|
+
__metadata: void 0,
|
|
2952
|
+
__applyId: void 0
|
|
2876
2953
|
})) });
|
|
2954
|
+
data.forEach((c) => {
|
|
2955
|
+
var _cmd$__applyId2;
|
|
2956
|
+
if (!c.id) return;
|
|
2957
|
+
const cmd = commands.find((co) => co.name === c.name && co.type === c.type);
|
|
2958
|
+
if (!cmd) return;
|
|
2959
|
+
(_cmd$__applyId2 = cmd.__applyId) === null || _cmd$__applyId2 === void 0 || _cmd$__applyId2.call(cmd, c.id);
|
|
2960
|
+
});
|
|
2877
2961
|
count += data.length;
|
|
2878
2962
|
}
|
|
2879
2963
|
Logger.info(`✨ Refreshed ${count} guild application (/) commands`);
|
|
@@ -3014,8 +3098,7 @@ var AppCommandHandler = class {
|
|
|
3014
3098
|
if (hasChildren) {
|
|
3015
3099
|
const children = categoryTree[category].sort();
|
|
3016
3100
|
children.forEach((childCategory, idx) => {
|
|
3017
|
-
|
|
3018
|
-
printCategory(childCategory, childIndent, childIsLast, childIndent);
|
|
3101
|
+
printCategory(childCategory, childIndent, idx === children.length - 1, childIndent);
|
|
3019
3102
|
});
|
|
3020
3103
|
}
|
|
3021
3104
|
};
|
|
@@ -3032,8 +3115,7 @@ var AppCommandHandler = class {
|
|
|
3032
3115
|
return true;
|
|
3033
3116
|
}).sort();
|
|
3034
3117
|
topLevelCategories.forEach((category, index) => {
|
|
3035
|
-
|
|
3036
|
-
printCategory(category, "", isLast);
|
|
3118
|
+
printCategory(category, "", index === topLevelCategories.length - 1);
|
|
3037
3119
|
});
|
|
3038
3120
|
}
|
|
3039
3121
|
/**
|
|
@@ -3158,6 +3240,15 @@ var AppCommandHandler = class {
|
|
|
3158
3240
|
}
|
|
3159
3241
|
return null;
|
|
3160
3242
|
}
|
|
3243
|
+
resolveMessageCommandName(name) {
|
|
3244
|
+
for (const [, loadedCommand] of this.loadedCommands) {
|
|
3245
|
+
var _loadedCommand$data$m3;
|
|
3246
|
+
if (loadedCommand.data.command.name === name) return loadedCommand.data.command.name;
|
|
3247
|
+
const aliases = (_loadedCommand$data$m3 = loadedCommand.data.metadata) === null || _loadedCommand$data$m3 === void 0 ? void 0 : _loadedCommand$data$m3.aliases;
|
|
3248
|
+
if (aliases && Array.isArray(aliases) && aliases.includes(name)) return loadedCommand.data.command.name;
|
|
3249
|
+
}
|
|
3250
|
+
return name;
|
|
3251
|
+
}
|
|
3161
3252
|
/**
|
|
3162
3253
|
* Reloads all commands and middleware from scratch.
|
|
3163
3254
|
*/
|
|
@@ -3219,8 +3310,7 @@ var AppCommandHandler = class {
|
|
|
3219
3310
|
if (require_constants.COMMANDKIT_IS_DEV) {
|
|
3220
3311
|
const commandNames = Array.from(this.loadedCommands.values()).map((v) => v.data.command.name);
|
|
3221
3312
|
const aliases = Array.from(this.loadedCommands.values()).flatMap((v) => v.metadata.aliases || []);
|
|
3222
|
-
|
|
3223
|
-
await require_types_package.rewriteCommandDeclaration(`type CommandTypeData = ${allNames.map((name) => JSON.stringify(name)).join(" | ")}`);
|
|
3313
|
+
await require_types_package.rewriteCommandDeclaration(`type CommandTypeData = ${[...commandNames, ...aliases].map((name) => JSON.stringify(name)).join(" | ")}`);
|
|
3224
3314
|
}
|
|
3225
3315
|
await this.commandkit.plugins.execute((ctx, plugin) => {
|
|
3226
3316
|
return plugin.onAfterCommandsLoad(ctx);
|
|
@@ -3255,6 +3345,7 @@ var AppCommandHandler = class {
|
|
|
3255
3345
|
try {
|
|
3256
3346
|
if (command.path === null) {
|
|
3257
3347
|
this.loadedCommands.set(id, {
|
|
3348
|
+
discordId: null,
|
|
3258
3349
|
command,
|
|
3259
3350
|
metadata: {
|
|
3260
3351
|
guilds: [],
|
|
@@ -3302,6 +3393,7 @@ var AppCommandHandler = class {
|
|
|
3302
3393
|
const commandJson = "toJSON" in lastUpdated && typeof lastUpdated.toJSON === "function" ? lastUpdated.toJSON() : lastUpdated;
|
|
3303
3394
|
if ("guilds" in commandJson || "aliases" in commandJson) Logger.warn(`Command \`${command.name}\` uses deprecated metadata properties. Please update to use the new \`metadata\` object or \`generateMetadata\` function.`);
|
|
3304
3395
|
this.loadedCommands.set(id, {
|
|
3396
|
+
discordId: null,
|
|
3305
3397
|
command,
|
|
3306
3398
|
metadata: {
|
|
3307
3399
|
guilds: commandJson.guilds,
|
|
@@ -3394,7 +3486,8 @@ var AppEventsHandler = class {
|
|
|
3394
3486
|
if (!handler.default || typeof handler.default !== "function") Logger.error`Event handler for ${event.event}${event.namespace ? ` of namespace ${event.namespace}` : ""} does not have a default export or is not a function`;
|
|
3395
3487
|
listeners.push({
|
|
3396
3488
|
handler: handler.default,
|
|
3397
|
-
once: !!handler.once
|
|
3489
|
+
once: !!handler.once,
|
|
3490
|
+
parallel: !!handler.parallel
|
|
3398
3491
|
});
|
|
3399
3492
|
}
|
|
3400
3493
|
const len = listeners.length;
|
|
@@ -3429,6 +3522,10 @@ var AppEventsHandler = class {
|
|
|
3429
3522
|
const { name, listeners, namespace } = data;
|
|
3430
3523
|
const onceListeners = listeners.filter((listener) => listener.once);
|
|
3431
3524
|
const onListeners = listeners.filter((listener) => !listener.once);
|
|
3525
|
+
const onParallelListeners = onListeners.filter((listener) => listener.parallel);
|
|
3526
|
+
const onSequentialListeners = onListeners.filter((listener) => !listener.parallel);
|
|
3527
|
+
const onceParallelListeners = onceListeners.filter((listener) => listener.parallel);
|
|
3528
|
+
const onceSequentialListeners = onceListeners.filter((listener) => !listener.parallel);
|
|
3432
3529
|
const executedOnceListeners = /* @__PURE__ */ new Set();
|
|
3433
3530
|
const mainHandler = async (...args) => {
|
|
3434
3531
|
let accepted = false;
|
|
@@ -3456,7 +3553,14 @@ var AppEventsHandler = class {
|
|
|
3456
3553
|
arguments: args,
|
|
3457
3554
|
variables: /* @__PURE__ */ new Map()
|
|
3458
3555
|
}, async () => {
|
|
3459
|
-
|
|
3556
|
+
if (onParallelListeners.length > 0) await Promise.all(onParallelListeners.map(async (listener) => {
|
|
3557
|
+
try {
|
|
3558
|
+
await listener.handler(...args, client, this.commandkit);
|
|
3559
|
+
} catch (e) {
|
|
3560
|
+
Logger.error`Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}: ${e}`;
|
|
3561
|
+
}
|
|
3562
|
+
}));
|
|
3563
|
+
for (const listener of onSequentialListeners) try {
|
|
3460
3564
|
await listener.handler(...args, client, this.commandkit);
|
|
3461
3565
|
} catch (e) {
|
|
3462
3566
|
if (require_error_codes.isErrorType(e, require_error_codes.CommandKitErrorCodes.StopEvents)) {
|
|
@@ -3486,7 +3590,25 @@ var AppEventsHandler = class {
|
|
|
3486
3590
|
if (accepted) return;
|
|
3487
3591
|
return (_plugin$willEmitEvent2 = plugin.willEmitEvent) === null || _plugin$willEmitEvent2 === void 0 ? void 0 : _plugin$willEmitEvent2.call(plugin, ctx, event);
|
|
3488
3592
|
}).catch(Object);
|
|
3489
|
-
|
|
3593
|
+
if (onceParallelListeners.length > 0) await Promise.all(onceParallelListeners.map(async (listener) => {
|
|
3594
|
+
return require_EventWorkerContext.runInEventWorkerContext({
|
|
3595
|
+
event: name,
|
|
3596
|
+
namespace: namespace ?? null,
|
|
3597
|
+
data: data.event,
|
|
3598
|
+
commandkit: this.commandkit,
|
|
3599
|
+
arguments: args,
|
|
3600
|
+
variables: /* @__PURE__ */ new Map()
|
|
3601
|
+
}, async () => {
|
|
3602
|
+
try {
|
|
3603
|
+
if (executedOnceListeners.has(listener.handler)) return;
|
|
3604
|
+
await listener.handler(...args, client, this.commandkit);
|
|
3605
|
+
executedOnceListeners.add(listener.handler);
|
|
3606
|
+
} catch (e) {
|
|
3607
|
+
Logger.error`Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}: ${e}`;
|
|
3608
|
+
}
|
|
3609
|
+
});
|
|
3610
|
+
}));
|
|
3611
|
+
for (const listener of onceSequentialListeners) {
|
|
3490
3612
|
if (broken) break;
|
|
3491
3613
|
await require_EventWorkerContext.runInEventWorkerContext({
|
|
3492
3614
|
event: name,
|
|
@@ -3518,7 +3640,8 @@ var AppEventsHandler = class {
|
|
|
3518
3640
|
...data,
|
|
3519
3641
|
mainListener: onListeners.length > 0 ? {
|
|
3520
3642
|
handler: mainHandler,
|
|
3521
|
-
once: false
|
|
3643
|
+
once: false,
|
|
3644
|
+
parallel: false
|
|
3522
3645
|
} : void 0,
|
|
3523
3646
|
executedOnceListeners
|
|
3524
3647
|
});
|
|
@@ -3529,7 +3652,7 @@ var AppEventsHandler = class {
|
|
|
3529
3652
|
if (onListeners.length > 0) client.on(name, mainHandler);
|
|
3530
3653
|
if (onceListeners.length > 0) client.once(name, onceHandler);
|
|
3531
3654
|
}
|
|
3532
|
-
Logger.info(`🔌 Registered event ${name}${namespace ? ` of namespace ${namespace}` : ""} (${
|
|
3655
|
+
Logger.info(`🔌 Registered event ${name}${namespace ? ` of namespace ${namespace}` : ""} (${onSequentialListeners.length} sequential, ${onParallelListeners.length} parallel, ${onceSequentialListeners.length} once-sequential, ${onceParallelListeners.length} once-parallel)`);
|
|
3533
3656
|
}
|
|
3534
3657
|
}
|
|
3535
3658
|
/**
|
|
@@ -3582,7 +3705,7 @@ async function loadConfigFile(entrypoint = require_constants.COMMANDKIT_CWD) {
|
|
|
3582
3705
|
if (loadedConfig) return loadedConfig;
|
|
3583
3706
|
const filePath = findConfigFile(entrypoint);
|
|
3584
3707
|
if (!filePath) return getConfig();
|
|
3585
|
-
const config = await require_common.loadConfigFileFromPath(filePath.path);
|
|
3708
|
+
const config = await require_common$1.loadConfigFileFromPath(filePath.path);
|
|
3586
3709
|
loadedConfig = config;
|
|
3587
3710
|
return config;
|
|
3588
3711
|
}
|
|
@@ -4187,6 +4310,12 @@ Object.defineProperty(exports, 'DefaultLogger', {
|
|
|
4187
4310
|
return DefaultLogger;
|
|
4188
4311
|
}
|
|
4189
4312
|
});
|
|
4313
|
+
Object.defineProperty(exports, 'FileUpload', {
|
|
4314
|
+
enumerable: true,
|
|
4315
|
+
get: function () {
|
|
4316
|
+
return FileUpload;
|
|
4317
|
+
}
|
|
4318
|
+
});
|
|
4190
4319
|
Object.defineProperty(exports, 'JsonSerialize', {
|
|
4191
4320
|
enumerable: true,
|
|
4192
4321
|
get: function () {
|
|
@@ -4307,6 +4436,12 @@ Object.defineProperty(exports, 'beforeExecute', {
|
|
|
4307
4436
|
return beforeExecute;
|
|
4308
4437
|
}
|
|
4309
4438
|
});
|
|
4439
|
+
Object.defineProperty(exports, 'buildOnly', {
|
|
4440
|
+
enumerable: true,
|
|
4441
|
+
get: function () {
|
|
4442
|
+
return buildOnly;
|
|
4443
|
+
}
|
|
4444
|
+
});
|
|
4310
4445
|
Object.defineProperty(exports, 'cancelAfter', {
|
|
4311
4446
|
enumerable: true,
|
|
4312
4447
|
get: function () {
|
|
@@ -4445,6 +4580,12 @@ Object.defineProperty(exports, 'noAnalytics', {
|
|
|
4445
4580
|
return noAnalytics;
|
|
4446
4581
|
}
|
|
4447
4582
|
});
|
|
4583
|
+
Object.defineProperty(exports, 'noBuildOnly', {
|
|
4584
|
+
enumerable: true,
|
|
4585
|
+
get: function () {
|
|
4586
|
+
return noBuildOnly;
|
|
4587
|
+
}
|
|
4588
|
+
});
|
|
4448
4589
|
Object.defineProperty(exports, 'onApplicationBootstrap', {
|
|
4449
4590
|
enumerable: true,
|
|
4450
4591
|
get: function () {
|
|
@@ -4481,4 +4622,4 @@ Object.defineProperty(exports, 'useStore', {
|
|
|
4481
4622
|
return useStore;
|
|
4482
4623
|
}
|
|
4483
4624
|
});
|
|
4484
|
-
//# sourceMappingURL=commandkit-
|
|
4625
|
+
//# sourceMappingURL=commandkit-SIjTLD2R.js.map
|