diff --git a/apps/docs/content/docs/classes/ButtonKit.mdx b/apps/docs/content/docs/classes/ButtonKit.mdx index 12710f2..2892778 100644 --- a/apps/docs/content/docs/classes/ButtonKit.mdx +++ b/apps/docs/content/docs/classes/ButtonKit.mdx @@ -23,7 +23,7 @@ The API data associated with this component. ### public dispose(): ButtonKit -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L165) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/components/ButtonKit.ts#L165) ### public onClick(handler, data?): this @@ -59,7 +59,7 @@ button.onClick(null); | handler | CommandKitButtonBuilderInteractionCollectorDispatch | ❌ | The handler to run when the button is clicked | | data | CommandKitButtonBuilderInteractionCollectorDispatchContextData | ✅ | The context data to use for the interaction collector | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L74) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/components/ButtonKit.ts#L74) ### public onEnd(handler): this @@ -67,7 +67,7 @@ button.onClick(null); | --------- | ---------------------------- | -------- | | handler | CommandKitButtonBuilderOnEnd | ❌ | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L98) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/components/ButtonKit.ts#L98) ### public setCustomId(customId): this diff --git a/apps/docs/content/docs/classes/CommandKit.mdx b/apps/docs/content/docs/classes/CommandKit.mdx index 16f9f2e..73611cf 100644 --- a/apps/docs/content/docs/classes/CommandKit.mdx +++ b/apps/docs/content/docs/classes/CommandKit.mdx @@ -17,47 +17,47 @@ CommandKit(options); ### public static \_instance: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L8) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L12) ### public client: any Get the client attached to this CommandKit instance. -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L38) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L42) ### public commandHandler: any Get command handler instance. -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L45) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L49) ### public commands: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L125) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L128) ### public commandsPath: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L141) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L144) ### public devGuildIds: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L169) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L172) ### public devRoleIds: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L176) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L179) ### public devUserIds: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L162) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L165) ### public eventsPath: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L148) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L151) ### public validationsPath: any -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L155) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L158) ## Methods @@ -69,16 +69,16 @@ Updates application commands with the latest from "commandsPath". | --------- | ------------- | -------- | | type | ReloadOptions | ✅ | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L101) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L104) ### public reloadEvents(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)> Updates application events with the latest from "eventsPath". -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L109) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L112) ### public reloadValidations(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)> Updates application command validations with the latest from "validationsPath". -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L117) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/CommandKit.ts#L120) diff --git a/apps/docs/content/docs/enums/ReloadType.mdx b/apps/docs/content/docs/enums/ReloadType.mdx index de5d97f..bf5b169 100644 --- a/apps/docs/content/docs/enums/ReloadType.mdx +++ b/apps/docs/content/docs/enums/ReloadType.mdx @@ -10,4 +10,4 @@ description: No description provided | Developer | 'dev' | N/A | Reload developer/guild commands. | | Global | 'global' | N/A | Reload global commands. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L284) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L275) diff --git a/apps/docs/content/docs/functions/defineConfig.mdx b/apps/docs/content/docs/functions/defineConfig.mdx index 923c578..d00a60b 100644 --- a/apps/docs/content/docs/functions/defineConfig.mdx +++ b/apps/docs/content/docs/functions/defineConfig.mdx @@ -9,4 +9,4 @@ description: No description provided | --------- | ---------------------------------------------------------------- | -------- | | config | PartialConfig\<[CommandKitConfig](/docs/types/CommandKitConfig)> | ❌ | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/config.ts#L71) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/config.ts#L71) diff --git a/apps/docs/content/docs/functions/getConfig.mdx b/apps/docs/content/docs/functions/getConfig.mdx index 0acc604..2dac78d 100644 --- a/apps/docs/content/docs/functions/getConfig.mdx +++ b/apps/docs/content/docs/functions/getConfig.mdx @@ -5,4 +5,4 @@ description: No description provided ### getConfig(): [CommandKitConfig](/docs/types/CommandKitConfig) -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/config.ts#L60) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/config.ts#L60) diff --git a/apps/docs/content/docs/types/AutocompleteProps.mdx b/apps/docs/content/docs/types/AutocompleteProps.mdx index 68f9334..b432afe 100644 --- a/apps/docs/content/docs/types/AutocompleteProps.mdx +++ b/apps/docs/content/docs/types/AutocompleteProps.mdx @@ -13,4 +13,4 @@ Props for autocomplete command run functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | AutocompleteInteraction\ | N/A | The current autocomplete command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L146) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L137) diff --git a/apps/docs/content/docs/types/CommandContext.mdx b/apps/docs/content/docs/types/CommandContext.mdx index f4b40a3..7d74411 100644 --- a/apps/docs/content/docs/types/CommandContext.mdx +++ b/apps/docs/content/docs/types/CommandContext.mdx @@ -13,4 +13,4 @@ Represents a command context. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The command data. | | interaction | Interaction\ | N/A | The interaction that triggered this command. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L80) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L71) diff --git a/apps/docs/content/docs/types/CommandData.mdx b/apps/docs/content/docs/types/CommandData.mdx index 2c691d0..6d33a6d 100644 --- a/apps/docs/content/docs/types/CommandData.mdx +++ b/apps/docs/content/docs/types/CommandData.mdx @@ -7,4 +7,4 @@ description: No description provided - Type: RESTPostAPIApplicationCommandsJSONBody -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L256) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L247) diff --git a/apps/docs/content/docs/types/CommandFileObject.mdx b/apps/docs/content/docs/types/CommandFileObject.mdx index 87d5607..2d7c34e 100644 --- a/apps/docs/content/docs/types/CommandFileObject.mdx +++ b/apps/docs/content/docs/types/CommandFileObject.mdx @@ -16,4 +16,4 @@ Represents a command file. | options | CommandOptions | N/A | | run | ( ctx: CommandContext\ ) => void | N/A | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L101) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L92) diff --git a/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatch.mdx b/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatch.mdx index f958a75..80589b1 100644 --- a/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatch.mdx +++ b/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatch.mdx @@ -12,4 +12,4 @@ If the first argument is null, it means that the interaction collector has been interaction: ButtonInteraction ) => Awaitable\ -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L17) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/components/ButtonKit.ts#L17) diff --git a/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatchContextData.mdx b/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatchContextData.mdx index 0923242..d1ffd05 100644 --- a/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatchContextData.mdx +++ b/apps/docs/content/docs/types/CommandKitButtonBuilderInteractionCollectorDispatchContextData.mdx @@ -11,4 +11,4 @@ description: No description provided time: number } & Omit\, 'filter' \| 'componentType'> -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L23) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/components/ButtonKit.ts#L23) diff --git a/apps/docs/content/docs/types/CommandKitButtonBuilderOnEnd.mdx b/apps/docs/content/docs/types/CommandKitButtonBuilderOnEnd.mdx index 5376172..1164af2 100644 --- a/apps/docs/content/docs/types/CommandKitButtonBuilderOnEnd.mdx +++ b/apps/docs/content/docs/types/CommandKitButtonBuilderOnEnd.mdx @@ -9,4 +9,4 @@ description: No description provided ...args: unknown\[] ) => Awaitable\ -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L21) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/components/ButtonKit.ts#L21) diff --git a/apps/docs/content/docs/types/CommandKitConfig.mdx b/apps/docs/content/docs/types/CommandKitConfig.mdx index ddfa60d..47fa6d2 100644 --- a/apps/docs/content/docs/types/CommandKitConfig.mdx +++ b/apps/docs/content/docs/types/CommandKitConfig.mdx @@ -19,4 +19,4 @@ description: No description provided | src | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | N/A | The source directory of the project. | | watch | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | N/A | Whether or not to use the watch mode. Defaults to `true`. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/config.ts#L1) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/config.ts#L1) diff --git a/apps/docs/content/docs/types/CommandKitData.mdx b/apps/docs/content/docs/types/CommandKitData.mdx index 3f0201e..9319673 100644 --- a/apps/docs/content/docs/types/CommandKitData.mdx +++ b/apps/docs/content/docs/types/CommandKitData.mdx @@ -18,9 +18,8 @@ Private data for the CommandKit class. | devUserIds | Array\ | N/A | List of developer user IDs to restrict devOnly commands to. | | eventHandler | EventHandler | N/A | N/A | | eventsPath | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | N/A | The path to your events directory. | -| experimental | \{ hooks: boolean } | N/A | Options for experimental features. | | skipBuiltInValidations | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | N/A | Skip CommandKit's built-in validations (for devOnly commands). | | validationHandler | ValidationHandler | N/A | N/A | | validationsPath | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | N/A | The path to the validations directory. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L71) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L62) diff --git a/apps/docs/content/docs/types/CommandKitOptions.mdx b/apps/docs/content/docs/types/CommandKitOptions.mdx index f79b622..ca85924 100644 --- a/apps/docs/content/docs/types/CommandKitOptions.mdx +++ b/apps/docs/content/docs/types/CommandKitOptions.mdx @@ -16,8 +16,7 @@ Options for instantiating a CommandKit handler. | devRoleIds | Array\ | N/A | List of developer role IDs to restrict devOnly commands to. | | devUserIds | Array\ | N/A | List of developer user IDs to restrict devOnly commands to. | | eventsPath | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | N/A | The path to your events directory. | -| experimental | \{ hooks: boolean } | N/A | Options for experimental features. | | skipBuiltInValidations | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | N/A | Skip CommandKit's built-in validations (for devOnly commands). | | validationsPath | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | N/A | The path to the validations directory. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L20) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L20) diff --git a/apps/docs/content/docs/types/CommandObject.mdx b/apps/docs/content/docs/types/CommandObject.mdx index 56d7cea..a2eb22b 100644 --- a/apps/docs/content/docs/types/CommandObject.mdx +++ b/apps/docs/content/docs/types/CommandObject.mdx @@ -12,4 +12,4 @@ description: No description provided options: CommandOptions } -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L258) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L249) diff --git a/apps/docs/content/docs/types/CommandOptions.mdx b/apps/docs/content/docs/types/CommandOptions.mdx index fe5c4e1..ccea80e 100644 --- a/apps/docs/content/docs/types/CommandOptions.mdx +++ b/apps/docs/content/docs/types/CommandOptions.mdx @@ -15,4 +15,4 @@ Additional command configuration options. | guildOnly | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | N/A | A boolean indicating whether the command is guild-only. Used for built-in validation. | | userPermissions | 'CreateInstantInvite' \| 'KickMembers' \| 'BanMembers' \| 'Administrator' \| 'ManageChannels' \| 'ManageGuild' \| 'AddReactions' \| 'ViewAuditLog' \| 'PrioritySpeaker' \| 'Stream' \| 'ViewChannel' \| 'SendMessages' \| 'SendTTSMessages' \| 'ManageMessages' \| 'EmbedLinks' \| 'AttachFiles' \| 'ReadMessageHistory' \| 'MentionEveryone' \| 'UseExternalEmojis' \| 'ViewGuildInsights' \| 'Connect' \| 'Speak' \| 'MuteMembers' \| 'DeafenMembers' \| 'MoveMembers' \| 'UseVAD' \| 'ChangeNickname' \| 'ManageNicknames' \| 'ManageRoles' \| 'ManageWebhooks' \| 'ManageEmojisAndStickers' \| 'ManageGuildExpressions' \| 'UseApplicationCommands' \| 'RequestToSpeak' \| 'ManageEvents' \| 'ManageThreads' \| 'CreatePublicThreads' \| 'CreatePrivateThreads' \| 'UseExternalStickers' \| 'SendMessagesInThreads' \| 'UseEmbeddedActivities' \| 'ModerateMembers' \| 'ViewCreatorMonetizationAnalytics' \| 'UseSoundboard' \| 'CreateGuildExpressions' \| 'CreateEvents' \| 'UseExternalSounds' \| 'SendVoiceMessages' \| 'SendPolls' \| 'UseExternalApps' \| Array\<'CreateInstantInvite' \| 'KickMembers' \| 'BanMembers' \| 'Administrator' \| 'ManageChannels' \| 'ManageGuild' \| 'AddReactions' \| 'ViewAuditLog' \| 'PrioritySpeaker' \| 'Stream' \| 'ViewChannel' \| 'SendMessages' \| 'SendTTSMessages' \| 'ManageMessages' \| 'EmbedLinks' \| 'AttachFiles' \| 'ReadMessageHistory' \| 'MentionEveryone' \| 'UseExternalEmojis' \| 'ViewGuildInsights' \| 'Connect' \| 'Speak' \| 'MuteMembers' \| 'DeafenMembers' \| 'MoveMembers' \| 'UseVAD' \| 'ChangeNickname' \| 'ManageNicknames' \| 'ManageRoles' \| 'ManageWebhooks' \| 'ManageEmojisAndStickers' \| 'ManageGuildExpressions' \| 'UseApplicationCommands' \| 'RequestToSpeak' \| 'ManageEvents' \| 'ManageThreads' \| 'CreatePublicThreads' \| 'CreatePrivateThreads' \| 'UseExternalStickers' \| 'SendMessagesInThreads' \| 'UseEmbeddedActivities' \| 'ModerateMembers' \| 'ViewCreatorMonetizationAnalytics' \| 'UseSoundboard' \| 'CreateGuildExpressions' \| 'CreateEvents' \| 'UseExternalSounds' \| 'SendVoiceMessages' \| 'SendPolls' \| 'UseExternalApps'> | N/A | A string or array of permissions that a user needs for the current command to be executed. Used for built-in validation. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L215) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L206) diff --git a/apps/docs/content/docs/types/CommandProps.mdx b/apps/docs/content/docs/types/CommandProps.mdx index 56a4770..b8d2b5a 100644 --- a/apps/docs/content/docs/types/CommandProps.mdx +++ b/apps/docs/content/docs/types/CommandProps.mdx @@ -13,4 +13,4 @@ Props for command run functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | ChatInputCommandInteraction\ \| MessageContextMenuCommandInteraction\ \| UserContextMenuCommandInteraction\ \| AutocompleteInteraction\ \| ContextMenuCommandInteraction\ | N/A | The current command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L123) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L114) diff --git a/apps/docs/content/docs/types/ContextMenuCommandProps.mdx b/apps/docs/content/docs/types/ContextMenuCommandProps.mdx index 0fa9060..8bd92c0 100644 --- a/apps/docs/content/docs/types/ContextMenuCommandProps.mdx +++ b/apps/docs/content/docs/types/ContextMenuCommandProps.mdx @@ -13,4 +13,4 @@ Props for context menu command run functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | ContextMenuCommandInteraction\ | N/A | The current context menu command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L166) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L157) diff --git a/apps/docs/content/docs/types/MessageContextMenuCommandProps.mdx b/apps/docs/content/docs/types/MessageContextMenuCommandProps.mdx index d06adc0..e257bf9 100644 --- a/apps/docs/content/docs/types/MessageContextMenuCommandProps.mdx +++ b/apps/docs/content/docs/types/MessageContextMenuCommandProps.mdx @@ -13,4 +13,4 @@ Props for message context menu command run functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | MessageContextMenuCommandInteraction\ | N/A | The current command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L183) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L174) diff --git a/apps/docs/content/docs/types/ReloadOptions.mdx b/apps/docs/content/docs/types/ReloadOptions.mdx index be88822..0c672ee 100644 --- a/apps/docs/content/docs/types/ReloadOptions.mdx +++ b/apps/docs/content/docs/types/ReloadOptions.mdx @@ -9,4 +9,4 @@ A reload type for commands. - Type: 'dev' \| 'global' \| ReloadType -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L118) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L109) diff --git a/apps/docs/content/docs/types/SlashCommandProps.mdx b/apps/docs/content/docs/types/SlashCommandProps.mdx index ec51416..d35b853 100644 --- a/apps/docs/content/docs/types/SlashCommandProps.mdx +++ b/apps/docs/content/docs/types/SlashCommandProps.mdx @@ -13,4 +13,4 @@ Props for slash (chat input) command run functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | ChatInputCommandInteraction\ | N/A | The current slash (chat input) command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L156) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L147) diff --git a/apps/docs/content/docs/types/UserContextMenuCommandProps.mdx b/apps/docs/content/docs/types/UserContextMenuCommandProps.mdx index f8fee69..1243d7b 100644 --- a/apps/docs/content/docs/types/UserContextMenuCommandProps.mdx +++ b/apps/docs/content/docs/types/UserContextMenuCommandProps.mdx @@ -13,4 +13,4 @@ Props for user context menu command run functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | UserContextMenuCommandInteraction\ | N/A | The current command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L176) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L167) diff --git a/apps/docs/content/docs/types/ValidationProps.mdx b/apps/docs/content/docs/types/ValidationProps.mdx index da5b4b6..ae05de9 100644 --- a/apps/docs/content/docs/types/ValidationProps.mdx +++ b/apps/docs/content/docs/types/ValidationProps.mdx @@ -14,4 +14,4 @@ Props for command validation functions. | handler | [CommandKit](/docs/classes/CommandKit) | N/A | The current CommandKit handler instance. | | interaction | ChatInputCommandInteraction\ \| AutocompleteInteraction\ \| ContextMenuCommandInteraction\ | N/A | The current command interaction object. | -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L190) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/types.ts#L181) diff --git a/apps/docs/content/docs/variables/version.mdx b/apps/docs/content/docs/variables/version.mdx index 5245d3a..a612284 100644 --- a/apps/docs/content/docs/variables/version.mdx +++ b/apps/docs/content/docs/variables/version.mdx @@ -9,4 +9,4 @@ The current version of CommandKit. - Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) -- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/index.ts#L11) +- [Source](https://github.com/underctrl-io/commandkit/blob/6ce87cba44f953b46a72430cb1272818640529f4/packages/commandkit/src/index.ts#L11) diff --git a/package.json b/package.json index 9252c62..ddc5547 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "turbo lint && prettier --check ./ --ignore-path=.prettierignore", "build": "turbo lint && turbo build", "deploy:package": "turbo deploy:package --filter='commandkit' --filter='create-commandkit'", - "docgen": "tsx ./scripts/docgen.ts", + "docgen": "tsx ./scripts/docgen.ts && pnpm format", "format": "prettier --write ./ --ignore-path=.prettierignore" }, "devDependencies": { diff --git a/packages/commandkit/src/CommandKit.ts b/packages/commandkit/src/CommandKit.ts index 7cf54be..1827ef8 100644 --- a/packages/commandkit/src/CommandKit.ts +++ b/packages/commandkit/src/CommandKit.ts @@ -1,10 +1,10 @@ +import { CommandHandler, EventHandler, ValidationHandler } from './handlers'; import type { CommandKitData, CommandKitOptions, - ReloadOptions, CommandObject, + ReloadOptions, } from './types'; -import { CommandHandler, EventHandler, ValidationHandler } from './handlers'; import colors from './utils/colors'; export class CommandKit { @@ -90,7 +90,6 @@ export class CommandKit { skipBuiltInValidations: this.#data.skipBuiltInValidations || false, commandkitInstance: this, bulkRegister: this.#data.bulkRegister || false, - enableHooks: this.#data.experimental?.hooks ?? false, }); await commandHandler.init(); diff --git a/packages/commandkit/src/handlers/command-handler/CommandHandler.ts b/packages/commandkit/src/handlers/command-handler/CommandHandler.ts index 35f3cad..cba4692 100644 --- a/packages/commandkit/src/handlers/command-handler/CommandHandler.ts +++ b/packages/commandkit/src/handlers/command-handler/CommandHandler.ts @@ -1,20 +1,20 @@ +import type { + CommandData, + CommandFileObject, + ReloadOptions, +} from '../../types'; +import { clone } from '../../utils/clone'; +import colors from '../../utils/colors'; +import { getFilePaths } from '../../utils/get-paths'; +import { toFileURL } from '../../utils/resolve-file-url'; +import loadCommandsWithRest from './functions/loadCommandsWithRest'; +import registerCommands from './functions/registerCommands'; import type { CommandHandlerData, CommandHandlerOptions, CommandKitInteraction, } from './typings'; -import type { CommandFileObject, ReloadOptions } from '../../types'; - -import { toFileURL } from '../../utils/resolve-file-url'; -import { getFilePaths } from '../../utils/get-paths'; -import { clone } from '../../utils/clone'; - -import loadCommandsWithRest from './functions/loadCommandsWithRest'; -import registerCommands from './functions/registerCommands'; import builtInValidationsFunctions from './validations'; -import colors from '../../utils/colors'; -import { AsyncLocalStorage } from 'async_hooks'; -import type { CommandData } from '../../types'; export interface hCommandContext { interaction: CommandKitInteraction; @@ -26,7 +26,6 @@ export interface hCommandContext { */ export class CommandHandler { #data: CommandHandlerData; - context: AsyncLocalStorage | null = null; constructor({ ...options }: CommandHandlerOptions) { this.#data = { @@ -37,9 +36,6 @@ export class CommandHandler { } async init() { - if (this.#data.enableHooks && !this.context) { - this.context = new AsyncLocalStorage(); - } await this.#buildCommands(); this.#buildBuiltInValidations(); @@ -178,8 +174,6 @@ export class CommandHandler { } handleCommands() { - const areHooksEnabled = this.#data.enableHooks; - this.#data.client.on('interactionCreate', async (interaction) => { if ( !interaction.isChatInputCommand() && @@ -251,28 +245,14 @@ export class CommandHandler { const command = targetCommand[isAutocomplete ? 'autocomplete' : 'run']!; - // if hooks are not enabled, pass the context to the command via its arguments - if (!areHooksEnabled) { - const context = { - interaction, - client: this.#data.client, - handler: this.#data.commandkitInstance, - }; - return await command(context); - } - - // @ts-expect-error - context data is not passed when hooks are enabled - return command(); + const context = { + interaction, + client: this.#data.client, + handler: this.#data.commandkitInstance, + }; + return await command(context); }; - if (this.context) - return this.context.run( - { - command: targetCommand.data, - interaction, - }, - executor, - ); return executor(); }); } diff --git a/packages/commandkit/src/handlers/command-handler/typings.ts b/packages/commandkit/src/handlers/command-handler/typings.ts index d5137b5..d96dd8c 100644 --- a/packages/commandkit/src/handlers/command-handler/typings.ts +++ b/packages/commandkit/src/handlers/command-handler/typings.ts @@ -57,10 +57,6 @@ export interface CommandHandlerOptions { * A boolean indicating whether to register all commands in bulk. */ bulkRegister: boolean; - /** - * Whether to enable hooks context. - */ - enableHooks: boolean; } /** diff --git a/packages/commandkit/src/types.ts b/packages/commandkit/src/types.ts index 3d5270f..73f7a57 100644 --- a/packages/commandkit/src/types.ts +++ b/packages/commandkit/src/types.ts @@ -54,15 +54,6 @@ export interface CommandKitOptions { * Bulk register application commands instead of one-by-one. */ bulkRegister?: boolean; - /** - * Options for experimental features. - */ - experimental?: { - /** - * Enable hooks. This allows you to utilize hooks such as `useInteraction()` to access the interaction object anywhere inside the command. - */ - hooks?: boolean; - }; } /**