bakit 2.0.0-alpha.16 → 2.0.0-alpha.17
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.d.ts +28 -2
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
|
-
import { ChatInputCommandInteraction, CacheType, Message, User, MessageCreateOptions, InteractionReplyOptions, Awaitable, Collection, Events, IntentsBitField, ClientEvents, Client, ClientOptions } from 'discord.js';
|
|
2
|
+
import { ChatInputCommandInteraction, CacheType, Message, User, MessageCreateOptions, InteractionReplyOptions, Awaitable, Collection, Events, IntentsBitField, ClientEvents, Client, ClientOptions, GatewayIntentBits } from 'discord.js';
|
|
3
3
|
import { inspect } from 'node:util';
|
|
4
4
|
import z from 'zod';
|
|
5
5
|
|
|
@@ -456,4 +456,30 @@ declare const messageCommandHandler: Listener<Events.MessageCreate>;
|
|
|
456
456
|
declare const chatInputCommandHandler: Listener<Events.InteractionCreate>;
|
|
457
457
|
declare const registerCommandsHandler: Listener<Events.ClientReady>;
|
|
458
458
|
|
|
459
|
-
|
|
459
|
+
declare const ProjectConfigSchema: z.ZodObject<{
|
|
460
|
+
intents: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodBigInt, z.ZodArray<z.ZodEnum<typeof GatewayIntentBits>>]>>;
|
|
461
|
+
clientOptions: z.ZodOptional<z.ZodCustom<Omit<ClientOptions, "intents">, Omit<ClientOptions, "intents">>>;
|
|
462
|
+
prefixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
463
|
+
token: z.ZodString;
|
|
464
|
+
}, z.z.core.$strip>;
|
|
465
|
+
type ProjectConfigInput = z.input<typeof ProjectConfigSchema>;
|
|
466
|
+
type ProjectConfig = z.output<typeof ProjectConfigSchema>;
|
|
467
|
+
/**
|
|
468
|
+
* Define config object for your project. This is just a cleaner way to define config.
|
|
469
|
+
* @param config The partial version of project config.
|
|
470
|
+
* @returns The same config you provided earlier.
|
|
471
|
+
*/
|
|
472
|
+
declare function defineConfig(config: ProjectConfigInput): ProjectConfigInput;
|
|
473
|
+
/**
|
|
474
|
+
* Load the config file and save them for later usage.
|
|
475
|
+
* @param cwd The location of the config file, uses root by default.
|
|
476
|
+
* @returns The complete config with default values from the validation.
|
|
477
|
+
*/
|
|
478
|
+
declare function loadConfig(cwd?: string): Promise<ProjectConfig>;
|
|
479
|
+
/**
|
|
480
|
+
* Get the loaded config of the project.
|
|
481
|
+
* @returns The project config.
|
|
482
|
+
*/
|
|
483
|
+
declare function getConfig(): ProjectConfig;
|
|
484
|
+
|
|
485
|
+
export { type AnyParam, ArgumentError, BakitClient, type BakitClientEvents, BakitError, BaseClientManager, BaseCommandContext, BaseParam, type BaseParamOptions, BaseParamSchema, ChatInputContext, type ChatInputContextSendOptions, Command, type CommandContext, CommandManager, type CommandOptions, type CommandOptionsInput, CommandOptionsSchema, Context, type ContextSendOptions, EVENT_INTENT_MAPPING, type ErrorHookCallback, type GetPrefixFunction, HookOrder, HookState, type InferParamTuple, type InferParamValue, Instance, LifecycleManager, Listener, ListenerManager, type ListenerOptions, ListenerOptionsSchema, type MainHookCallback, MessageContext, type MessageContextSendOptions, type NumberOptions, NumberParam, NumberParamSchema, type ParamResolvedOutputType, ParamUserType, Params, ProjectCacheManager, type ProjectConfig, type ProjectConfigInput, ProjectConfigSchema, type StringOptions, StringParam, StringParamSchema, type UserOptions, UserParam, UserParamSchema, chatInputCommandHandler, defineCommand, defineConfig, defineListener, extractSnowflakeId, getConfig, getTopLevelDirectory, importModule, isModuleLoaded, loadConfig, messageCommandHandler, registerCommandsHandler, tokenize, unloadModule, useApp, validateParamsOrder };
|
package/dist/index.js
CHANGED
|
@@ -778,6 +778,9 @@ var ProjectConfigSchema = z4.object({
|
|
|
778
778
|
prefixes: z4.array(z4.string()).default([]),
|
|
779
779
|
token: z4.string()
|
|
780
780
|
});
|
|
781
|
+
function defineConfig(config) {
|
|
782
|
+
return config;
|
|
783
|
+
}
|
|
781
784
|
var _config;
|
|
782
785
|
async function loadConfig(cwd = process.cwd()) {
|
|
783
786
|
if (_config)
|
|
@@ -949,4 +952,4 @@ var Params = {
|
|
|
949
952
|
user: createFactory(UserParam)
|
|
950
953
|
};
|
|
951
954
|
|
|
952
|
-
export { ArgumentError, BakitClient, BakitError, BaseClientManager, BaseCommandContext, BaseParam, BaseParamSchema, ChatInputContext, Command, CommandManager, CommandOptionsSchema, Context, EVENT_INTENT_MAPPING, HookOrder, HookState, Instance, LifecycleManager, Listener, ListenerManager, ListenerOptionsSchema, MessageContext, NumberParam, NumberParamSchema, ParamUserType, Params, ProjectCacheManager, StringParam, StringParamSchema, UserParam, UserParamSchema, chatInputCommandHandler, defineCommand, defineListener, extractSnowflakeId, getTopLevelDirectory, importModule, isModuleLoaded, messageCommandHandler, registerCommandsHandler, tokenize, unloadModule, useApp, validateParamsOrder };
|
|
955
|
+
export { ArgumentError, BakitClient, BakitError, BaseClientManager, BaseCommandContext, BaseParam, BaseParamSchema, ChatInputContext, Command, CommandManager, CommandOptionsSchema, Context, EVENT_INTENT_MAPPING, HookOrder, HookState, Instance, LifecycleManager, Listener, ListenerManager, ListenerOptionsSchema, MessageContext, NumberParam, NumberParamSchema, ParamUserType, Params, ProjectCacheManager, ProjectConfigSchema, StringParam, StringParamSchema, UserParam, UserParamSchema, chatInputCommandHandler, defineCommand, defineConfig, defineListener, extractSnowflakeId, getConfig, getTopLevelDirectory, importModule, isModuleLoaded, loadConfig, messageCommandHandler, registerCommandsHandler, tokenize, unloadModule, useApp, validateParamsOrder };
|