vimcord 1.0.40 → 1.0.42
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 +50 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -9
- package/dist/index.d.ts +11 -9
- package/dist/index.js +50 -41
- 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
|
@@ -2166,10 +2166,13 @@ declare class Vimcord<Ready extends boolean = boolean> extends Client<Ready> {
|
|
|
2166
2166
|
clientReady(clientTag: string, guildCount: number): void;
|
|
2167
2167
|
moduleLoaded(moduleName: string, count?: number, ignoredCount?: number): void;
|
|
2168
2168
|
commandExecuted(commandName: string, username: string, guildName?: string): void;
|
|
2169
|
+
plugin(pluginName: string, action: string, details?: string): void;
|
|
2169
2170
|
database(action: string, details?: string): void;
|
|
2170
2171
|
};
|
|
2171
2172
|
readonly error: VimcordErrorHandler;
|
|
2172
2173
|
constructor(options: ClientOptions, features?: VimcordFeatures, config?: PartialDeep<VimcordConfig>);
|
|
2174
|
+
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2175
|
+
private build;
|
|
2173
2176
|
/** Current app name */
|
|
2174
2177
|
get $name(): string;
|
|
2175
2178
|
set $name(name: string);
|
|
@@ -2196,15 +2199,6 @@ declare class Vimcord<Ready extends boolean = boolean> extends Client<Ready> {
|
|
|
2196
2199
|
* @param options The options to set for the config.
|
|
2197
2200
|
*/
|
|
2198
2201
|
configure<T extends keyof VimcordConfig>(type: T, options?: PartialDeep<VimcordConfig[T]>): this;
|
|
2199
|
-
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2200
|
-
build(): Promise<this>;
|
|
2201
|
-
/**
|
|
2202
|
-
* Imports modules into the client.
|
|
2203
|
-
* @param type The type of modules to import.
|
|
2204
|
-
* @param options The options to import the module with.
|
|
2205
|
-
* @param set Replaces already imported modules with the ones found.
|
|
2206
|
-
*/
|
|
2207
|
-
importModules<T extends keyof AppModuleImports>(type: T, options: AppModuleImports[T], set?: boolean): Promise<this>;
|
|
2208
2202
|
/**
|
|
2209
2203
|
* Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
|
|
2210
2204
|
* @param options Options for dotenv
|
|
@@ -2216,6 +2210,13 @@ declare class Vimcord<Ready extends boolean = boolean> extends Client<Ready> {
|
|
|
2216
2210
|
* @param db The database manager to use.
|
|
2217
2211
|
*/
|
|
2218
2212
|
useDatabase(db: DatabaseManager): Promise<boolean>;
|
|
2213
|
+
/**
|
|
2214
|
+
* Imports modules into the client.
|
|
2215
|
+
* @param type The type of modules to import.
|
|
2216
|
+
* @param options The options to import the module with.
|
|
2217
|
+
* @param set Replaces already imported modules with the ones found.
|
|
2218
|
+
*/
|
|
2219
|
+
importModules<T extends keyof AppModuleImports>(type: T, options: AppModuleImports[T], set?: boolean): Promise<this>;
|
|
2219
2220
|
/**
|
|
2220
2221
|
* Fetches a user from the client, checking the cache first.
|
|
2221
2222
|
* @param userId The ID of the user to fetch.
|
|
@@ -2266,6 +2267,7 @@ declare const clientLoggerFactory: (client: Vimcord) => Logger & {
|
|
|
2266
2267
|
clientReady(clientTag: string, guildCount: number): void;
|
|
2267
2268
|
moduleLoaded(moduleName: string, count?: number, ignoredCount?: number): void;
|
|
2268
2269
|
commandExecuted(commandName: string, username: string, guildName?: string): void;
|
|
2270
|
+
plugin(pluginName: string, action: string, details?: string): void;
|
|
2269
2271
|
database(action: string, details?: string): void;
|
|
2270
2272
|
};
|
|
2271
2273
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2166,10 +2166,13 @@ declare class Vimcord<Ready extends boolean = boolean> extends Client<Ready> {
|
|
|
2166
2166
|
clientReady(clientTag: string, guildCount: number): void;
|
|
2167
2167
|
moduleLoaded(moduleName: string, count?: number, ignoredCount?: number): void;
|
|
2168
2168
|
commandExecuted(commandName: string, username: string, guildName?: string): void;
|
|
2169
|
+
plugin(pluginName: string, action: string, details?: string): void;
|
|
2169
2170
|
database(action: string, details?: string): void;
|
|
2170
2171
|
};
|
|
2171
2172
|
readonly error: VimcordErrorHandler;
|
|
2172
2173
|
constructor(options: ClientOptions, features?: VimcordFeatures, config?: PartialDeep<VimcordConfig>);
|
|
2174
|
+
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2175
|
+
private build;
|
|
2173
2176
|
/** Current app name */
|
|
2174
2177
|
get $name(): string;
|
|
2175
2178
|
set $name(name: string);
|
|
@@ -2196,15 +2199,6 @@ declare class Vimcord<Ready extends boolean = boolean> extends Client<Ready> {
|
|
|
2196
2199
|
* @param options The options to set for the config.
|
|
2197
2200
|
*/
|
|
2198
2201
|
configure<T extends keyof VimcordConfig>(type: T, options?: PartialDeep<VimcordConfig[T]>): this;
|
|
2199
|
-
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2200
|
-
build(): Promise<this>;
|
|
2201
|
-
/**
|
|
2202
|
-
* Imports modules into the client.
|
|
2203
|
-
* @param type The type of modules to import.
|
|
2204
|
-
* @param options The options to import the module with.
|
|
2205
|
-
* @param set Replaces already imported modules with the ones found.
|
|
2206
|
-
*/
|
|
2207
|
-
importModules<T extends keyof AppModuleImports>(type: T, options: AppModuleImports[T], set?: boolean): Promise<this>;
|
|
2208
2202
|
/**
|
|
2209
2203
|
* Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
|
|
2210
2204
|
* @param options Options for dotenv
|
|
@@ -2216,6 +2210,13 @@ declare class Vimcord<Ready extends boolean = boolean> extends Client<Ready> {
|
|
|
2216
2210
|
* @param db The database manager to use.
|
|
2217
2211
|
*/
|
|
2218
2212
|
useDatabase(db: DatabaseManager): Promise<boolean>;
|
|
2213
|
+
/**
|
|
2214
|
+
* Imports modules into the client.
|
|
2215
|
+
* @param type The type of modules to import.
|
|
2216
|
+
* @param options The options to import the module with.
|
|
2217
|
+
* @param set Replaces already imported modules with the ones found.
|
|
2218
|
+
*/
|
|
2219
|
+
importModules<T extends keyof AppModuleImports>(type: T, options: AppModuleImports[T], set?: boolean): Promise<this>;
|
|
2219
2220
|
/**
|
|
2220
2221
|
* Fetches a user from the client, checking the cache first.
|
|
2221
2222
|
* @param userId The ID of the user to fetch.
|
|
@@ -2266,6 +2267,7 @@ declare const clientLoggerFactory: (client: Vimcord) => Logger & {
|
|
|
2266
2267
|
clientReady(clientTag: string, guildCount: number): void;
|
|
2267
2268
|
moduleLoaded(moduleName: string, count?: number, ignoredCount?: number): void;
|
|
2268
2269
|
commandExecuted(commandName: string, username: string, guildName?: string): void;
|
|
2270
|
+
plugin(pluginName: string, action: string, details?: string): void;
|
|
2269
2271
|
database(action: string, details?: string): void;
|
|
2270
2272
|
};
|
|
2271
2273
|
|
package/dist/index.js
CHANGED
|
@@ -1693,7 +1693,7 @@ var VimcordErrorHandler = class {
|
|
|
1693
1693
|
import chalk2 from "chalk";
|
|
1694
1694
|
|
|
1695
1695
|
// package.json
|
|
1696
|
-
var version = "1.0.
|
|
1696
|
+
var version = "1.0.41";
|
|
1697
1697
|
|
|
1698
1698
|
// src/client/vimcord.logger.ts
|
|
1699
1699
|
var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix: `vimcord (i${client.clientId})` }).extend({
|
|
@@ -1704,7 +1704,7 @@ var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix
|
|
|
1704
1704
|
\u2554${border}\u2557`));
|
|
1705
1705
|
console.log(
|
|
1706
1706
|
chalk2.hex(this.colors.primary)("\u2551") + chalk2.bold.hex(this.colors.text)(
|
|
1707
|
-
` \u{1F680} ${client2
|
|
1707
|
+
` \u{1F680} ${client2.$name} v${client2.$version}`.padEnd(50 - (client2.$devMode ? 12 : 0))
|
|
1708
1708
|
) + chalk2.hex(this.colors.primary)(`${client2.$devMode ? chalk2.hex(this.colors.warn)("devMode \u26A0\uFE0F ") : ""}\u2551`)
|
|
1709
1709
|
);
|
|
1710
1710
|
console.log(chalk2.hex(this.colors.primary)(`\u2551${"".padEnd(50)}\u2551`));
|
|
@@ -1747,6 +1747,15 @@ var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix
|
|
|
1747
1747
|
chalk2.hex(this.colors.muted)(location)
|
|
1748
1748
|
);
|
|
1749
1749
|
},
|
|
1750
|
+
plugin(pluginName, action, details) {
|
|
1751
|
+
console.log(
|
|
1752
|
+
this.formatTimestamp(),
|
|
1753
|
+
this.formatPrefix(),
|
|
1754
|
+
chalk2.hex("#FF6B9D")(`\u{1F50C} ${pluginName}`),
|
|
1755
|
+
chalk2.white(action),
|
|
1756
|
+
details ? chalk2.hex(this.colors.muted)(details) : ""
|
|
1757
|
+
);
|
|
1758
|
+
},
|
|
1750
1759
|
database(action, details) {
|
|
1751
1760
|
console.log(
|
|
1752
1761
|
this.formatTimestamp(),
|
|
@@ -2643,13 +2652,40 @@ var Vimcord = class _Vimcord extends Client2 {
|
|
|
2643
2652
|
this.status = new StatusManager(this);
|
|
2644
2653
|
this.events = new EventManager(this);
|
|
2645
2654
|
this.commands = new CommandManager(this);
|
|
2646
|
-
this.logger.clientBanner(this);
|
|
2647
2655
|
this.once("clientReady", (client) => this.logger.clientReady(client.user.tag, client.guilds.cache.size));
|
|
2648
2656
|
_Vimcord.instances.set(this.clientId, this);
|
|
2649
2657
|
if (this.config.app.enableCLI) {
|
|
2650
2658
|
VimcordCLI.setMode("on");
|
|
2651
2659
|
}
|
|
2652
2660
|
}
|
|
2661
|
+
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2662
|
+
async build() {
|
|
2663
|
+
this.configure("app", this.config.app);
|
|
2664
|
+
this.configure("staff", this.config.staff);
|
|
2665
|
+
this.configure("slashCommands", this.config.slashCommands);
|
|
2666
|
+
this.configure("prefixCommands", this.config.prefixCommands);
|
|
2667
|
+
this.configure("contextCommands", this.config.contextCommands);
|
|
2668
|
+
this.logger.clientBanner(this);
|
|
2669
|
+
if (this.features.importModules) {
|
|
2670
|
+
const importModules = this.features.importModules;
|
|
2671
|
+
await Promise.all([
|
|
2672
|
+
importModules.events && this.importModules("events", importModules.events),
|
|
2673
|
+
importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
|
|
2674
|
+
importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
|
|
2675
|
+
importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
|
|
2676
|
+
]);
|
|
2677
|
+
}
|
|
2678
|
+
if (this.features.useDefaultSlashCommandHandler) {
|
|
2679
|
+
this.events.register(slashCommandHandler);
|
|
2680
|
+
}
|
|
2681
|
+
if (this.features.useDefaultContextCommandHandler) {
|
|
2682
|
+
this.events.register(contextCommandHandler);
|
|
2683
|
+
}
|
|
2684
|
+
if (this.features.useDefaultPrefixCommandHandler) {
|
|
2685
|
+
this.events.register(prefixCommandHandler);
|
|
2686
|
+
}
|
|
2687
|
+
return this;
|
|
2688
|
+
}
|
|
2653
2689
|
/** Current app name */
|
|
2654
2690
|
// prettier-ignore
|
|
2655
2691
|
get $name() {
|
|
@@ -2704,50 +2740,13 @@ var Vimcord = class _Vimcord extends Client2 {
|
|
|
2704
2740
|
this.config[type] = configSetters[type](options, this.config[type]);
|
|
2705
2741
|
return this;
|
|
2706
2742
|
}
|
|
2707
|
-
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2708
|
-
async build() {
|
|
2709
|
-
this.configure("app", this.config.app);
|
|
2710
|
-
this.configure("staff", this.config.staff);
|
|
2711
|
-
this.configure("slashCommands", this.config.slashCommands);
|
|
2712
|
-
this.configure("prefixCommands", this.config.prefixCommands);
|
|
2713
|
-
this.configure("contextCommands", this.config.contextCommands);
|
|
2714
|
-
if (this.features.importModules) {
|
|
2715
|
-
const importModules = this.features.importModules;
|
|
2716
|
-
await Promise.all([
|
|
2717
|
-
importModules.events && this.importModules("events", importModules.events),
|
|
2718
|
-
importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
|
|
2719
|
-
importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
|
|
2720
|
-
importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
|
|
2721
|
-
]);
|
|
2722
|
-
}
|
|
2723
|
-
if (this.features.useDefaultSlashCommandHandler) {
|
|
2724
|
-
this.events.register(slashCommandHandler);
|
|
2725
|
-
}
|
|
2726
|
-
if (this.features.useDefaultContextCommandHandler) {
|
|
2727
|
-
this.events.register(contextCommandHandler);
|
|
2728
|
-
}
|
|
2729
|
-
if (this.features.useDefaultPrefixCommandHandler) {
|
|
2730
|
-
this.events.register(prefixCommandHandler);
|
|
2731
|
-
}
|
|
2732
|
-
return this;
|
|
2733
|
-
}
|
|
2734
|
-
/**
|
|
2735
|
-
* Imports modules into the client.
|
|
2736
|
-
* @param type The type of modules to import.
|
|
2737
|
-
* @param options The options to import the module with.
|
|
2738
|
-
* @param set Replaces already imported modules with the ones found.
|
|
2739
|
-
*/
|
|
2740
|
-
async importModules(type, options, set) {
|
|
2741
|
-
await moduleImporters[type](this, options, set);
|
|
2742
|
-
return this;
|
|
2743
|
-
}
|
|
2744
2743
|
/**
|
|
2745
2744
|
* Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
|
|
2746
2745
|
* @param options Options for dotenv
|
|
2747
2746
|
* @see https://www.npmjs.com/package/dotenv
|
|
2748
2747
|
*/
|
|
2749
2748
|
useEnv(options) {
|
|
2750
|
-
this.logger.
|
|
2749
|
+
this.logger.plugin("ENV", "Using", "dotenv");
|
|
2751
2750
|
configDotenv({ quiet: true, ...options });
|
|
2752
2751
|
return this;
|
|
2753
2752
|
}
|
|
@@ -2760,6 +2759,16 @@ var Vimcord = class _Vimcord extends Client2 {
|
|
|
2760
2759
|
this.logger.database("Using", db.moduleName);
|
|
2761
2760
|
return this.db.connect();
|
|
2762
2761
|
}
|
|
2762
|
+
/**
|
|
2763
|
+
* Imports modules into the client.
|
|
2764
|
+
* @param type The type of modules to import.
|
|
2765
|
+
* @param options The options to import the module with.
|
|
2766
|
+
* @param set Replaces already imported modules with the ones found.
|
|
2767
|
+
*/
|
|
2768
|
+
async importModules(type, options, set) {
|
|
2769
|
+
await moduleImporters[type](this, options, set);
|
|
2770
|
+
return this;
|
|
2771
|
+
}
|
|
2763
2772
|
/**
|
|
2764
2773
|
* Fetches a user from the client, checking the cache first.
|
|
2765
2774
|
* @param userId The ID of the user to fetch.
|