vimcord 1.0.41 → 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.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
- private build;
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
- private build;
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.40";
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({
@@ -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(),
@@ -2649,6 +2658,34 @@ var Vimcord = class _Vimcord extends Client2 {
2649
2658
  VimcordCLI.setMode("on");
2650
2659
  }
2651
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
+ }
2652
2689
  /** Current app name */
2653
2690
  // prettier-ignore
2654
2691
  get $name() {
@@ -2703,50 +2740,13 @@ var Vimcord = class _Vimcord extends Client2 {
2703
2740
  this.config[type] = configSetters[type](options, this.config[type]);
2704
2741
  return this;
2705
2742
  }
2706
- /** Builds the client by importing modules and registering builtin handlers. */
2707
- async build() {
2708
- this.configure("app", this.config.app);
2709
- this.configure("staff", this.config.staff);
2710
- this.configure("slashCommands", this.config.slashCommands);
2711
- this.configure("prefixCommands", this.config.prefixCommands);
2712
- this.configure("contextCommands", this.config.contextCommands);
2713
- if (this.features.importModules) {
2714
- const importModules = this.features.importModules;
2715
- await Promise.all([
2716
- importModules.events && this.importModules("events", importModules.events),
2717
- importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
2718
- importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
2719
- importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
2720
- ]);
2721
- }
2722
- if (this.features.useDefaultSlashCommandHandler) {
2723
- this.events.register(slashCommandHandler);
2724
- }
2725
- if (this.features.useDefaultContextCommandHandler) {
2726
- this.events.register(contextCommandHandler);
2727
- }
2728
- if (this.features.useDefaultPrefixCommandHandler) {
2729
- this.events.register(prefixCommandHandler);
2730
- }
2731
- return this;
2732
- }
2733
- /**
2734
- * Imports modules into the client.
2735
- * @param type The type of modules to import.
2736
- * @param options The options to import the module with.
2737
- * @param set Replaces already imported modules with the ones found.
2738
- */
2739
- async importModules(type, options, set) {
2740
- await moduleImporters[type](this, options, set);
2741
- return this;
2742
- }
2743
2743
  /**
2744
2744
  * Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
2745
2745
  * @param options Options for dotenv
2746
2746
  * @see https://www.npmjs.com/package/dotenv
2747
2747
  */
2748
2748
  useEnv(options) {
2749
- this.logger.database("Using", "dotenv");
2749
+ this.logger.plugin("ENV", "Using", "dotenv");
2750
2750
  configDotenv({ quiet: true, ...options });
2751
2751
  return this;
2752
2752
  }
@@ -2759,6 +2759,16 @@ var Vimcord = class _Vimcord extends Client2 {
2759
2759
  this.logger.database("Using", db.moduleName);
2760
2760
  return this.db.connect();
2761
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
+ }
2762
2772
  /**
2763
2773
  * Fetches a user from the client, checking the cache first.
2764
2774
  * @param userId The ID of the user to fetch.
@@ -2786,7 +2796,6 @@ var Vimcord = class _Vimcord extends Client2 {
2786
2796
  );
2787
2797
  }
2788
2798
  await this.build();
2789
- this.logger.clientBanner(this);
2790
2799
  try {
2791
2800
  const stopLoader = this.logger.loader("Connecting to Discord...");
2792
2801
  const loginResult = await $4.async.retry(() => super.login(token), {