vimcord 1.0.56 → 1.0.58
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/dist/index.cjs +11 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -113,9 +113,7 @@ interface BaseCommandConfig<T extends CommandType> {
|
|
|
113
113
|
/** Log whenever a command is executed? @defaultValue true */
|
|
114
114
|
logExecution?: boolean;
|
|
115
115
|
/** Executed before the main command logic */
|
|
116
|
-
beforeExecute?: (ctx:
|
|
117
|
-
cancel: () => void;
|
|
118
|
-
}, ...args: BaseCommandParameters<T>) => any;
|
|
116
|
+
beforeExecute?: (ctx: CommandBeforeExecuteContext, ...args: BaseCommandParameters<T>) => unknown;
|
|
119
117
|
/** The main command function that will be executed */
|
|
120
118
|
execute?: (...args: BaseCommandParameters<T>) => any;
|
|
121
119
|
/** Executed after successful execution */
|
|
@@ -131,6 +129,10 @@ interface BaseCommandConfig<T extends CommandType> {
|
|
|
131
129
|
/** Custom error handler */
|
|
132
130
|
onError?: (error: Error, ...args: BaseCommandParameters<T>) => any;
|
|
133
131
|
}
|
|
132
|
+
interface CommandBeforeExecuteContext {
|
|
133
|
+
readonly name: string;
|
|
134
|
+
cancel: () => void;
|
|
135
|
+
}
|
|
134
136
|
interface BaseAppCommandConfig {
|
|
135
137
|
/** Command deployment configuration */
|
|
136
138
|
deployment?: AppCommandDeployment;
|
|
@@ -958,9 +960,7 @@ declare const createContextCommandConfig: (options?: {
|
|
|
958
960
|
onRateLimit?: ((client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
959
961
|
} | undefined;
|
|
960
962
|
logExecution?: boolean | undefined;
|
|
961
|
-
beforeExecute?: ((ctx:
|
|
962
|
-
cancel: () => void;
|
|
963
|
-
}, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
963
|
+
beforeExecute?: ((ctx: CommandBeforeExecuteContext, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => unknown) | undefined;
|
|
964
964
|
execute?: ((client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
965
965
|
afterExecute?: ((result: any, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
966
966
|
onMissingPermissions?: ((results: CommandPermissionResults, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
@@ -1325,9 +1325,7 @@ declare const createPrefixCommandConfig: (options?: {
|
|
|
1325
1325
|
onRateLimit?: ((client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1326
1326
|
} | undefined;
|
|
1327
1327
|
logExecution?: boolean | undefined;
|
|
1328
|
-
beforeExecute?: ((ctx:
|
|
1329
|
-
cancel: () => void;
|
|
1330
|
-
}, client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1328
|
+
beforeExecute?: ((ctx: CommandBeforeExecuteContext, client: Vimcord<true>, message: discord_js.Message<boolean>) => unknown) | undefined;
|
|
1331
1329
|
execute?: ((client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1332
1330
|
afterExecute?: ((result: any, client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1333
1331
|
onMissingPermissions?: ((results: CommandPermissionResults, client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
@@ -1677,9 +1675,7 @@ declare const createSlashCommandConfig: (options?: {
|
|
|
1677
1675
|
onRateLimit?: ((client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1678
1676
|
} | undefined;
|
|
1679
1677
|
logExecution?: boolean | undefined;
|
|
1680
|
-
beforeExecute?: ((ctx:
|
|
1681
|
-
cancel: () => void;
|
|
1682
|
-
}, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1678
|
+
beforeExecute?: ((ctx: CommandBeforeExecuteContext, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => unknown) | undefined;
|
|
1683
1679
|
execute?: ((client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1684
1680
|
afterExecute?: ((result: any, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1685
1681
|
onMissingPermissions?: ((results: CommandPermissionResults, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
@@ -2311,6 +2307,7 @@ declare function createClient(options: ClientOptions, features?: VimcordFeatures
|
|
|
2311
2307
|
declare abstract class BaseCommandBuilder<T extends CommandType, O extends BaseCommandConfig<T> = BaseCommandConfig<T>> {
|
|
2312
2308
|
readonly uuid: string;
|
|
2313
2309
|
readonly commandType: T;
|
|
2310
|
+
name: string;
|
|
2314
2311
|
/** Local command configuration and hooks */
|
|
2315
2312
|
readonly options: O;
|
|
2316
2313
|
/** Internal state for rate limiting across different scopes */
|
|
@@ -2318,6 +2315,7 @@ declare abstract class BaseCommandBuilder<T extends CommandType, O extends BaseC
|
|
|
2318
2315
|
/** Mapping of CommandTypes to their respective config keys in the Vimcord client */
|
|
2319
2316
|
private readonly typeConfigMapping;
|
|
2320
2317
|
constructor(type: T, options?: O);
|
|
2318
|
+
protected setCommandName(name: string): void;
|
|
2321
2319
|
private validateBaseConfig;
|
|
2322
2320
|
/**
|
|
2323
2321
|
* Resolves the final configuration by merging layers:
|
|
@@ -2958,4 +2956,4 @@ declare function getPackageJson(): any;
|
|
|
2958
2956
|
/** Checks if the process was ran using the `--dev` flag. */
|
|
2959
2957
|
declare function getDevMode(): boolean;
|
|
2960
2958
|
|
|
2961
|
-
export { type AnySlashCommandBuilder, type AppCommandDeployment, type AppConfig, type AppModuleImports, type AwaitModalSubmitOptions, type BaseAppCommandConfig, BaseCommandBuilder, type BaseCommandConfig, BaseCommandManager, type BaseCommandParameters, type BetterAPIChannelSelectComponent, type BetterAPICheckboxComponent, type BetterAPICheckboxGroupComponent, type BetterAPIFileUploadComponent, type BetterAPIMentionableSelectComponent, type BetterAPIModalComponent, type BetterAPIRadioGroupComponent, type BetterAPIRoleSelectComponent, type BetterAPIStringSelectComponent, type BetterAPITextInputComponent, type BetterAPIUserSelectComponent, type BetterChannelSelectComponent, type BetterCheckboxComponent, type BetterCheckboxGroupComponent, BetterCollector, type BetterCollectorOptions, BetterContainer, type BetterContainerData, BetterEmbed, type BetterEmbedAuthor, type BetterEmbedContext, type BetterEmbedData, type BetterEmbedFooter, type BetterEmbedTitle, type BetterFileUploadComponent, type BetterMentionableSelectComponent, BetterModal, type BetterModalComponent, type BetterModalOptions, type BetterModalSubmitResult, type BetterRadioGroupComponent, type BetterRoleSelectComponent, type BetterStringSelectComponent, type BetterTextInputComponent, type BetterUserSelectComponent, type ButtonHandler, CLI, type Chapter, type ChapterData, type ClientActivity, type ClientStatus, CollectorTimeoutType, type CommandByCategory, type CommandErrorMessageConfig, type CommandFilter, type CommandInternalRateLimitData, CommandManager, type CommandMetadata, type CommandPermissionResults, type CommandPermissions, type CommandRateLimitOptions, CommandType, ContextCommandBuilder, type ContextCommandConfig, ContextCommandManager, type CustomButton, DEFAULT_MODULE_SUFFIXES, type DatabaseManager, DynaSend, type DynaSendOptions, type EmbedResolvable, ErrorHandler, EventBuilder, type EventConfig, type EventDeployment, EventManager, type EventMetadata, type EventParameters, type EventRateLimitOptions, type ExtractReturn, type FetchedChannel, type FetchedMessageMention, type GetMessageMentionOptions, type InteractionBasedSendHandler, type InteractionResolveable, LOGGER_COLORS, type LeanOrHydratedDocument, type ListenerOptions, LogLevel, Logger, type LoggerOptions, type MentionType, MissingPermissionReason, type ModalShowableInteraction, type ModuleImportOptions, ModuleImporter, MongoDatabase, type MongoPlugin, MongoSchemaBuilder, type MongoSchemaOptions, type PageIndex, type PageResolvable, type PaginationEvent, PaginationTimeoutType, PaginationType, Paginator, type PaginatorData, type PaginatorOptions, type PartialDeep, PrefixCommandBuilder, type PrefixCommandConfig, PrefixCommandManager, Prompt, type PromptOptions, PromptResolveType, type PromptResult, RateLimitScope, type RequiredDynaSendOptions, type SendHandler, SendMethod, type SendableComponent, type SendableTextChannel, type SinglePageResolvable, SlashCommandBuilder, type SlashCommandConfig, SlashCommandManager, type StaffConfig, StatusManager, StatusType, type ToolsConfig, type UserResolvable, Vimcord, VimcordCLI, type VimcordCLIMode, type VimcordCLIOptions, type VimcordClientStatus, type VimcordCommandBuilderByType, type VimcordConfig, type VimcordCreateConfig, VimcordErrorHandler, type VimcordFeatures, __zero, cleanMention, clientLoggerFactory, configSetters, contextCommandHandler, createAppConfig, createClient, createConfigFactory, createContextCommandConfig, createMongoPlugin, createMongoSchema, createPrefixCommandConfig, createSlashCommandConfig, createStaffConfig, createToolsConfig, createVimcordStatusConfig, deepMerge, defineClientOptions, defineGlobalToolsConfig, defineVimcordConfig, defineVimcordFeatures, dynaSend, fetchChannel, fetchGuild, fetchMember, fetchMessage, fetchRole, fetchUser, getDevMode, getFirstMentionId, getMessageMention, getPackageJson, globalToolsConfig, importModulesFromDir, isMentionOrSnowflake, logger, moduleImporters, prefixCommandHandler, prompt, sendCommandErrorEmbed, slashCommandHandler, useClient, useReadyClient, validateCommandPermissions };
|
|
2959
|
+
export { type AnySlashCommandBuilder, type AppCommandDeployment, type AppConfig, type AppModuleImports, type AwaitModalSubmitOptions, type BaseAppCommandConfig, BaseCommandBuilder, type BaseCommandConfig, BaseCommandManager, type BaseCommandParameters, type BetterAPIChannelSelectComponent, type BetterAPICheckboxComponent, type BetterAPICheckboxGroupComponent, type BetterAPIFileUploadComponent, type BetterAPIMentionableSelectComponent, type BetterAPIModalComponent, type BetterAPIRadioGroupComponent, type BetterAPIRoleSelectComponent, type BetterAPIStringSelectComponent, type BetterAPITextInputComponent, type BetterAPIUserSelectComponent, type BetterChannelSelectComponent, type BetterCheckboxComponent, type BetterCheckboxGroupComponent, BetterCollector, type BetterCollectorOptions, BetterContainer, type BetterContainerData, BetterEmbed, type BetterEmbedAuthor, type BetterEmbedContext, type BetterEmbedData, type BetterEmbedFooter, type BetterEmbedTitle, type BetterFileUploadComponent, type BetterMentionableSelectComponent, BetterModal, type BetterModalComponent, type BetterModalOptions, type BetterModalSubmitResult, type BetterRadioGroupComponent, type BetterRoleSelectComponent, type BetterStringSelectComponent, type BetterTextInputComponent, type BetterUserSelectComponent, type ButtonHandler, CLI, type Chapter, type ChapterData, type ClientActivity, type ClientStatus, CollectorTimeoutType, type CommandBeforeExecuteContext, type CommandByCategory, type CommandErrorMessageConfig, type CommandFilter, type CommandInternalRateLimitData, CommandManager, type CommandMetadata, type CommandPermissionResults, type CommandPermissions, type CommandRateLimitOptions, CommandType, ContextCommandBuilder, type ContextCommandConfig, ContextCommandManager, type CustomButton, DEFAULT_MODULE_SUFFIXES, type DatabaseManager, DynaSend, type DynaSendOptions, type EmbedResolvable, ErrorHandler, EventBuilder, type EventConfig, type EventDeployment, EventManager, type EventMetadata, type EventParameters, type EventRateLimitOptions, type ExtractReturn, type FetchedChannel, type FetchedMessageMention, type GetMessageMentionOptions, type InteractionBasedSendHandler, type InteractionResolveable, LOGGER_COLORS, type LeanOrHydratedDocument, type ListenerOptions, LogLevel, Logger, type LoggerOptions, type MentionType, MissingPermissionReason, type ModalShowableInteraction, type ModuleImportOptions, ModuleImporter, MongoDatabase, type MongoPlugin, MongoSchemaBuilder, type MongoSchemaOptions, type PageIndex, type PageResolvable, type PaginationEvent, PaginationTimeoutType, PaginationType, Paginator, type PaginatorData, type PaginatorOptions, type PartialDeep, PrefixCommandBuilder, type PrefixCommandConfig, PrefixCommandManager, Prompt, type PromptOptions, PromptResolveType, type PromptResult, RateLimitScope, type RequiredDynaSendOptions, type SendHandler, SendMethod, type SendableComponent, type SendableTextChannel, type SinglePageResolvable, SlashCommandBuilder, type SlashCommandConfig, SlashCommandManager, type StaffConfig, StatusManager, StatusType, type ToolsConfig, type UserResolvable, Vimcord, VimcordCLI, type VimcordCLIMode, type VimcordCLIOptions, type VimcordClientStatus, type VimcordCommandBuilderByType, type VimcordConfig, type VimcordCreateConfig, VimcordErrorHandler, type VimcordFeatures, __zero, cleanMention, clientLoggerFactory, configSetters, contextCommandHandler, createAppConfig, createClient, createConfigFactory, createContextCommandConfig, createMongoPlugin, createMongoSchema, createPrefixCommandConfig, createSlashCommandConfig, createStaffConfig, createToolsConfig, createVimcordStatusConfig, deepMerge, defineClientOptions, defineGlobalToolsConfig, defineVimcordConfig, defineVimcordFeatures, dynaSend, fetchChannel, fetchGuild, fetchMember, fetchMessage, fetchRole, fetchUser, getDevMode, getFirstMentionId, getMessageMention, getPackageJson, globalToolsConfig, importModulesFromDir, isMentionOrSnowflake, logger, moduleImporters, prefixCommandHandler, prompt, sendCommandErrorEmbed, slashCommandHandler, useClient, useReadyClient, validateCommandPermissions };
|
package/dist/index.d.ts
CHANGED
|
@@ -113,9 +113,7 @@ interface BaseCommandConfig<T extends CommandType> {
|
|
|
113
113
|
/** Log whenever a command is executed? @defaultValue true */
|
|
114
114
|
logExecution?: boolean;
|
|
115
115
|
/** Executed before the main command logic */
|
|
116
|
-
beforeExecute?: (ctx:
|
|
117
|
-
cancel: () => void;
|
|
118
|
-
}, ...args: BaseCommandParameters<T>) => any;
|
|
116
|
+
beforeExecute?: (ctx: CommandBeforeExecuteContext, ...args: BaseCommandParameters<T>) => unknown;
|
|
119
117
|
/** The main command function that will be executed */
|
|
120
118
|
execute?: (...args: BaseCommandParameters<T>) => any;
|
|
121
119
|
/** Executed after successful execution */
|
|
@@ -131,6 +129,10 @@ interface BaseCommandConfig<T extends CommandType> {
|
|
|
131
129
|
/** Custom error handler */
|
|
132
130
|
onError?: (error: Error, ...args: BaseCommandParameters<T>) => any;
|
|
133
131
|
}
|
|
132
|
+
interface CommandBeforeExecuteContext {
|
|
133
|
+
readonly name: string;
|
|
134
|
+
cancel: () => void;
|
|
135
|
+
}
|
|
134
136
|
interface BaseAppCommandConfig {
|
|
135
137
|
/** Command deployment configuration */
|
|
136
138
|
deployment?: AppCommandDeployment;
|
|
@@ -958,9 +960,7 @@ declare const createContextCommandConfig: (options?: {
|
|
|
958
960
|
onRateLimit?: ((client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
959
961
|
} | undefined;
|
|
960
962
|
logExecution?: boolean | undefined;
|
|
961
|
-
beforeExecute?: ((ctx:
|
|
962
|
-
cancel: () => void;
|
|
963
|
-
}, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
963
|
+
beforeExecute?: ((ctx: CommandBeforeExecuteContext, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => unknown) | undefined;
|
|
964
964
|
execute?: ((client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
965
965
|
afterExecute?: ((result: any, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
966
966
|
onMissingPermissions?: ((results: CommandPermissionResults, client: Vimcord<true>, interaction: discord_js.ContextMenuCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
@@ -1325,9 +1325,7 @@ declare const createPrefixCommandConfig: (options?: {
|
|
|
1325
1325
|
onRateLimit?: ((client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1326
1326
|
} | undefined;
|
|
1327
1327
|
logExecution?: boolean | undefined;
|
|
1328
|
-
beforeExecute?: ((ctx:
|
|
1329
|
-
cancel: () => void;
|
|
1330
|
-
}, client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1328
|
+
beforeExecute?: ((ctx: CommandBeforeExecuteContext, client: Vimcord<true>, message: discord_js.Message<boolean>) => unknown) | undefined;
|
|
1331
1329
|
execute?: ((client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1332
1330
|
afterExecute?: ((result: any, client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
1333
1331
|
onMissingPermissions?: ((results: CommandPermissionResults, client: Vimcord<true>, message: discord_js.Message<boolean>) => any) | undefined;
|
|
@@ -1677,9 +1675,7 @@ declare const createSlashCommandConfig: (options?: {
|
|
|
1677
1675
|
onRateLimit?: ((client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1678
1676
|
} | undefined;
|
|
1679
1677
|
logExecution?: boolean | undefined;
|
|
1680
|
-
beforeExecute?: ((ctx:
|
|
1681
|
-
cancel: () => void;
|
|
1682
|
-
}, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1678
|
+
beforeExecute?: ((ctx: CommandBeforeExecuteContext, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => unknown) | undefined;
|
|
1683
1679
|
execute?: ((client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1684
1680
|
afterExecute?: ((result: any, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
1685
1681
|
onMissingPermissions?: ((results: CommandPermissionResults, client: Vimcord<true>, interaction: discord_js.ChatInputCommandInteraction<discord_js.CacheType>) => any) | undefined;
|
|
@@ -2311,6 +2307,7 @@ declare function createClient(options: ClientOptions, features?: VimcordFeatures
|
|
|
2311
2307
|
declare abstract class BaseCommandBuilder<T extends CommandType, O extends BaseCommandConfig<T> = BaseCommandConfig<T>> {
|
|
2312
2308
|
readonly uuid: string;
|
|
2313
2309
|
readonly commandType: T;
|
|
2310
|
+
name: string;
|
|
2314
2311
|
/** Local command configuration and hooks */
|
|
2315
2312
|
readonly options: O;
|
|
2316
2313
|
/** Internal state for rate limiting across different scopes */
|
|
@@ -2318,6 +2315,7 @@ declare abstract class BaseCommandBuilder<T extends CommandType, O extends BaseC
|
|
|
2318
2315
|
/** Mapping of CommandTypes to their respective config keys in the Vimcord client */
|
|
2319
2316
|
private readonly typeConfigMapping;
|
|
2320
2317
|
constructor(type: T, options?: O);
|
|
2318
|
+
protected setCommandName(name: string): void;
|
|
2321
2319
|
private validateBaseConfig;
|
|
2322
2320
|
/**
|
|
2323
2321
|
* Resolves the final configuration by merging layers:
|
|
@@ -2958,4 +2956,4 @@ declare function getPackageJson(): any;
|
|
|
2958
2956
|
/** Checks if the process was ran using the `--dev` flag. */
|
|
2959
2957
|
declare function getDevMode(): boolean;
|
|
2960
2958
|
|
|
2961
|
-
export { type AnySlashCommandBuilder, type AppCommandDeployment, type AppConfig, type AppModuleImports, type AwaitModalSubmitOptions, type BaseAppCommandConfig, BaseCommandBuilder, type BaseCommandConfig, BaseCommandManager, type BaseCommandParameters, type BetterAPIChannelSelectComponent, type BetterAPICheckboxComponent, type BetterAPICheckboxGroupComponent, type BetterAPIFileUploadComponent, type BetterAPIMentionableSelectComponent, type BetterAPIModalComponent, type BetterAPIRadioGroupComponent, type BetterAPIRoleSelectComponent, type BetterAPIStringSelectComponent, type BetterAPITextInputComponent, type BetterAPIUserSelectComponent, type BetterChannelSelectComponent, type BetterCheckboxComponent, type BetterCheckboxGroupComponent, BetterCollector, type BetterCollectorOptions, BetterContainer, type BetterContainerData, BetterEmbed, type BetterEmbedAuthor, type BetterEmbedContext, type BetterEmbedData, type BetterEmbedFooter, type BetterEmbedTitle, type BetterFileUploadComponent, type BetterMentionableSelectComponent, BetterModal, type BetterModalComponent, type BetterModalOptions, type BetterModalSubmitResult, type BetterRadioGroupComponent, type BetterRoleSelectComponent, type BetterStringSelectComponent, type BetterTextInputComponent, type BetterUserSelectComponent, type ButtonHandler, CLI, type Chapter, type ChapterData, type ClientActivity, type ClientStatus, CollectorTimeoutType, type CommandByCategory, type CommandErrorMessageConfig, type CommandFilter, type CommandInternalRateLimitData, CommandManager, type CommandMetadata, type CommandPermissionResults, type CommandPermissions, type CommandRateLimitOptions, CommandType, ContextCommandBuilder, type ContextCommandConfig, ContextCommandManager, type CustomButton, DEFAULT_MODULE_SUFFIXES, type DatabaseManager, DynaSend, type DynaSendOptions, type EmbedResolvable, ErrorHandler, EventBuilder, type EventConfig, type EventDeployment, EventManager, type EventMetadata, type EventParameters, type EventRateLimitOptions, type ExtractReturn, type FetchedChannel, type FetchedMessageMention, type GetMessageMentionOptions, type InteractionBasedSendHandler, type InteractionResolveable, LOGGER_COLORS, type LeanOrHydratedDocument, type ListenerOptions, LogLevel, Logger, type LoggerOptions, type MentionType, MissingPermissionReason, type ModalShowableInteraction, type ModuleImportOptions, ModuleImporter, MongoDatabase, type MongoPlugin, MongoSchemaBuilder, type MongoSchemaOptions, type PageIndex, type PageResolvable, type PaginationEvent, PaginationTimeoutType, PaginationType, Paginator, type PaginatorData, type PaginatorOptions, type PartialDeep, PrefixCommandBuilder, type PrefixCommandConfig, PrefixCommandManager, Prompt, type PromptOptions, PromptResolveType, type PromptResult, RateLimitScope, type RequiredDynaSendOptions, type SendHandler, SendMethod, type SendableComponent, type SendableTextChannel, type SinglePageResolvable, SlashCommandBuilder, type SlashCommandConfig, SlashCommandManager, type StaffConfig, StatusManager, StatusType, type ToolsConfig, type UserResolvable, Vimcord, VimcordCLI, type VimcordCLIMode, type VimcordCLIOptions, type VimcordClientStatus, type VimcordCommandBuilderByType, type VimcordConfig, type VimcordCreateConfig, VimcordErrorHandler, type VimcordFeatures, __zero, cleanMention, clientLoggerFactory, configSetters, contextCommandHandler, createAppConfig, createClient, createConfigFactory, createContextCommandConfig, createMongoPlugin, createMongoSchema, createPrefixCommandConfig, createSlashCommandConfig, createStaffConfig, createToolsConfig, createVimcordStatusConfig, deepMerge, defineClientOptions, defineGlobalToolsConfig, defineVimcordConfig, defineVimcordFeatures, dynaSend, fetchChannel, fetchGuild, fetchMember, fetchMessage, fetchRole, fetchUser, getDevMode, getFirstMentionId, getMessageMention, getPackageJson, globalToolsConfig, importModulesFromDir, isMentionOrSnowflake, logger, moduleImporters, prefixCommandHandler, prompt, sendCommandErrorEmbed, slashCommandHandler, useClient, useReadyClient, validateCommandPermissions };
|
|
2959
|
+
export { type AnySlashCommandBuilder, type AppCommandDeployment, type AppConfig, type AppModuleImports, type AwaitModalSubmitOptions, type BaseAppCommandConfig, BaseCommandBuilder, type BaseCommandConfig, BaseCommandManager, type BaseCommandParameters, type BetterAPIChannelSelectComponent, type BetterAPICheckboxComponent, type BetterAPICheckboxGroupComponent, type BetterAPIFileUploadComponent, type BetterAPIMentionableSelectComponent, type BetterAPIModalComponent, type BetterAPIRadioGroupComponent, type BetterAPIRoleSelectComponent, type BetterAPIStringSelectComponent, type BetterAPITextInputComponent, type BetterAPIUserSelectComponent, type BetterChannelSelectComponent, type BetterCheckboxComponent, type BetterCheckboxGroupComponent, BetterCollector, type BetterCollectorOptions, BetterContainer, type BetterContainerData, BetterEmbed, type BetterEmbedAuthor, type BetterEmbedContext, type BetterEmbedData, type BetterEmbedFooter, type BetterEmbedTitle, type BetterFileUploadComponent, type BetterMentionableSelectComponent, BetterModal, type BetterModalComponent, type BetterModalOptions, type BetterModalSubmitResult, type BetterRadioGroupComponent, type BetterRoleSelectComponent, type BetterStringSelectComponent, type BetterTextInputComponent, type BetterUserSelectComponent, type ButtonHandler, CLI, type Chapter, type ChapterData, type ClientActivity, type ClientStatus, CollectorTimeoutType, type CommandBeforeExecuteContext, type CommandByCategory, type CommandErrorMessageConfig, type CommandFilter, type CommandInternalRateLimitData, CommandManager, type CommandMetadata, type CommandPermissionResults, type CommandPermissions, type CommandRateLimitOptions, CommandType, ContextCommandBuilder, type ContextCommandConfig, ContextCommandManager, type CustomButton, DEFAULT_MODULE_SUFFIXES, type DatabaseManager, DynaSend, type DynaSendOptions, type EmbedResolvable, ErrorHandler, EventBuilder, type EventConfig, type EventDeployment, EventManager, type EventMetadata, type EventParameters, type EventRateLimitOptions, type ExtractReturn, type FetchedChannel, type FetchedMessageMention, type GetMessageMentionOptions, type InteractionBasedSendHandler, type InteractionResolveable, LOGGER_COLORS, type LeanOrHydratedDocument, type ListenerOptions, LogLevel, Logger, type LoggerOptions, type MentionType, MissingPermissionReason, type ModalShowableInteraction, type ModuleImportOptions, ModuleImporter, MongoDatabase, type MongoPlugin, MongoSchemaBuilder, type MongoSchemaOptions, type PageIndex, type PageResolvable, type PaginationEvent, PaginationTimeoutType, PaginationType, Paginator, type PaginatorData, type PaginatorOptions, type PartialDeep, PrefixCommandBuilder, type PrefixCommandConfig, PrefixCommandManager, Prompt, type PromptOptions, PromptResolveType, type PromptResult, RateLimitScope, type RequiredDynaSendOptions, type SendHandler, SendMethod, type SendableComponent, type SendableTextChannel, type SinglePageResolvable, SlashCommandBuilder, type SlashCommandConfig, SlashCommandManager, type StaffConfig, StatusManager, StatusType, type ToolsConfig, type UserResolvable, Vimcord, VimcordCLI, type VimcordCLIMode, type VimcordCLIOptions, type VimcordClientStatus, type VimcordCommandBuilderByType, type VimcordConfig, type VimcordCreateConfig, VimcordErrorHandler, type VimcordFeatures, __zero, cleanMention, clientLoggerFactory, configSetters, contextCommandHandler, createAppConfig, createClient, createConfigFactory, createContextCommandConfig, createMongoPlugin, createMongoSchema, createPrefixCommandConfig, createSlashCommandConfig, createStaffConfig, createToolsConfig, createVimcordStatusConfig, deepMerge, defineClientOptions, defineGlobalToolsConfig, defineVimcordConfig, defineVimcordFeatures, dynaSend, fetchChannel, fetchGuild, fetchMember, fetchMessage, fetchRole, fetchUser, getDevMode, getFirstMentionId, getMessageMention, getPackageJson, globalToolsConfig, importModulesFromDir, isMentionOrSnowflake, logger, moduleImporters, prefixCommandHandler, prompt, sendCommandErrorEmbed, slashCommandHandler, useClient, useReadyClient, validateCommandPermissions };
|
package/dist/index.js
CHANGED
|
@@ -161,6 +161,7 @@ import { randomUUID } from "crypto";
|
|
|
161
161
|
var BaseCommandBuilder = class {
|
|
162
162
|
uuid = randomUUID();
|
|
163
163
|
commandType;
|
|
164
|
+
name = "";
|
|
164
165
|
/** Local command configuration and hooks */
|
|
165
166
|
options;
|
|
166
167
|
/** Internal state for rate limiting across different scopes */
|
|
@@ -180,6 +181,9 @@ var BaseCommandBuilder = class {
|
|
|
180
181
|
this.commandType = type;
|
|
181
182
|
this.options = { enabled: true, ...options };
|
|
182
183
|
}
|
|
184
|
+
setCommandName(name) {
|
|
185
|
+
this.name = name;
|
|
186
|
+
}
|
|
183
187
|
validateBaseConfig() {
|
|
184
188
|
if (this.options.rateLimit) {
|
|
185
189
|
const { max, interval } = this.options.rateLimit;
|
|
@@ -221,13 +225,12 @@ var BaseCommandBuilder = class {
|
|
|
221
225
|
return await config.onConditionsNotMet?.(...args);
|
|
222
226
|
}
|
|
223
227
|
if (config.beforeExecute) {
|
|
224
|
-
await config.beforeExecute?.({ cancel }, ...args);
|
|
228
|
+
await config.beforeExecute?.({ cancel, name: this.name }, ...args);
|
|
225
229
|
if (canceled) return;
|
|
226
230
|
}
|
|
227
231
|
if (config.logExecution !== false) {
|
|
228
|
-
const cmdName = this.options.name || this.builder?.name || "Unknown";
|
|
229
232
|
const location = ctx.guild ? `${ctx.guild.name} (${ctx.guild.id})` : "Direct Messages";
|
|
230
|
-
client.logger.commandExecuted(
|
|
233
|
+
client.logger.commandExecuted(this.name || "Unknown", ctx.user.username, location);
|
|
231
234
|
}
|
|
232
235
|
const result = await config.execute?.(...args);
|
|
233
236
|
await config.afterExecute?.(result, ...args);
|
|
@@ -371,6 +374,7 @@ var ContextCommandBuilder = class extends BaseCommandBuilder {
|
|
|
371
374
|
setBuilder(builder) {
|
|
372
375
|
this.builder = typeof builder === "function" ? builder(new ContextMenuCommandBuilder()) : builder;
|
|
373
376
|
this.validateBuilder();
|
|
377
|
+
this.setCommandName(this.builder.name);
|
|
374
378
|
return this;
|
|
375
379
|
}
|
|
376
380
|
setExecute(fn) {
|
|
@@ -713,6 +717,7 @@ var PrefixCommandBuilder = class extends BaseCommandBuilder {
|
|
|
713
717
|
constructor(options) {
|
|
714
718
|
super(1 /* Prefix */, options);
|
|
715
719
|
this.options = options;
|
|
720
|
+
this.setCommandName(options.name);
|
|
716
721
|
const originalExecute = this.options.execute;
|
|
717
722
|
this.options.execute = async (client, message) => {
|
|
718
723
|
return await this.handleExecution(client, message, originalExecute);
|
|
@@ -791,6 +796,7 @@ var SlashCommandBuilder = class extends BaseCommandBuilder {
|
|
|
791
796
|
setBuilder(builder) {
|
|
792
797
|
this.builder = typeof builder === "function" ? builder(new DJSSlashCommandBuilder()) : builder;
|
|
793
798
|
this.validateBuilder();
|
|
799
|
+
this.setCommandName(this.builder.name);
|
|
794
800
|
return this;
|
|
795
801
|
}
|
|
796
802
|
addRoutes(...routes) {
|
|
@@ -1701,7 +1707,7 @@ var VimcordErrorHandler = class {
|
|
|
1701
1707
|
import chalk2 from "chalk";
|
|
1702
1708
|
|
|
1703
1709
|
// package.json
|
|
1704
|
-
var version = "1.0.
|
|
1710
|
+
var version = "1.0.57";
|
|
1705
1711
|
|
|
1706
1712
|
// src/client/vimcord.logger.ts
|
|
1707
1713
|
var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix: `vimcord (i${client.clientId})` }).extend({
|
|
@@ -3218,7 +3224,7 @@ var BetterCollector = class _BetterCollector {
|
|
|
3218
3224
|
if (!this.message) return;
|
|
3219
3225
|
if (this.collector) return;
|
|
3220
3226
|
this.collector = this.message.createMessageComponentCollector({
|
|
3221
|
-
idle: this.options?.idle ?? this.config.timeouts.collectorIdle,
|
|
3227
|
+
idle: this.options?.timeout ? void 0 : this.options?.idle ?? this.config.timeouts.collectorIdle,
|
|
3222
3228
|
time: this.options?.timeout ?? this.config.timeouts.collectorTimeout,
|
|
3223
3229
|
componentType: this.options?.type,
|
|
3224
3230
|
max: this.options?.max,
|