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 CHANGED
@@ -1787,7 +1787,7 @@ var VimcordErrorHandler = class {
1787
1787
  var import_chalk2 = __toESM(require("chalk"));
1788
1788
 
1789
1789
  // package.json
1790
- var version = "1.0.38";
1790
+ var version = "1.0.41";
1791
1791
 
1792
1792
  // src/client/vimcord.logger.ts
1793
1793
  var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix: `vimcord (i${client.clientId})` }).extend({
@@ -1798,7 +1798,7 @@ var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix
1798
1798
  \u2554${border}\u2557`));
1799
1799
  console.log(
1800
1800
  import_chalk2.default.hex(this.colors.primary)("\u2551") + import_chalk2.default.bold.hex(this.colors.text)(
1801
- ` \u{1F680} ${client2.config.app.name} v${client2.$version}`.padEnd(50 - (client2.$devMode ? 12 : 0))
1801
+ ` \u{1F680} ${client2.$name} v${client2.$version}`.padEnd(50 - (client2.$devMode ? 12 : 0))
1802
1802
  ) + import_chalk2.default.hex(this.colors.primary)(`${client2.$devMode ? import_chalk2.default.hex(this.colors.warn)("devMode \u26A0\uFE0F ") : ""}\u2551`)
1803
1803
  );
1804
1804
  console.log(import_chalk2.default.hex(this.colors.primary)(`\u2551${"".padEnd(50)}\u2551`));
@@ -1841,6 +1841,15 @@ var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix
1841
1841
  import_chalk2.default.hex(this.colors.muted)(location)
1842
1842
  );
1843
1843
  },
1844
+ plugin(pluginName, action, details) {
1845
+ console.log(
1846
+ this.formatTimestamp(),
1847
+ this.formatPrefix(),
1848
+ import_chalk2.default.hex("#FF6B9D")(`\u{1F50C} ${pluginName}`),
1849
+ import_chalk2.default.white(action),
1850
+ details ? import_chalk2.default.hex(this.colors.muted)(details) : ""
1851
+ );
1852
+ },
1844
1853
  database(action, details) {
1845
1854
  console.log(
1846
1855
  this.formatTimestamp(),
@@ -2737,13 +2746,40 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
2737
2746
  this.status = new StatusManager(this);
2738
2747
  this.events = new EventManager(this);
2739
2748
  this.commands = new CommandManager(this);
2740
- this.logger.clientBanner(this);
2741
2749
  this.once("clientReady", (client) => this.logger.clientReady(client.user.tag, client.guilds.cache.size));
2742
2750
  _Vimcord.instances.set(this.clientId, this);
2743
2751
  if (this.config.app.enableCLI) {
2744
2752
  VimcordCLI.setMode("on");
2745
2753
  }
2746
2754
  }
2755
+ /** Builds the client by importing modules and registering builtin handlers. */
2756
+ async build() {
2757
+ this.configure("app", this.config.app);
2758
+ this.configure("staff", this.config.staff);
2759
+ this.configure("slashCommands", this.config.slashCommands);
2760
+ this.configure("prefixCommands", this.config.prefixCommands);
2761
+ this.configure("contextCommands", this.config.contextCommands);
2762
+ this.logger.clientBanner(this);
2763
+ if (this.features.importModules) {
2764
+ const importModules = this.features.importModules;
2765
+ await Promise.all([
2766
+ importModules.events && this.importModules("events", importModules.events),
2767
+ importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
2768
+ importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
2769
+ importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
2770
+ ]);
2771
+ }
2772
+ if (this.features.useDefaultSlashCommandHandler) {
2773
+ this.events.register(slashCommandHandler);
2774
+ }
2775
+ if (this.features.useDefaultContextCommandHandler) {
2776
+ this.events.register(contextCommandHandler);
2777
+ }
2778
+ if (this.features.useDefaultPrefixCommandHandler) {
2779
+ this.events.register(prefixCommandHandler);
2780
+ }
2781
+ return this;
2782
+ }
2747
2783
  /** Current app name */
2748
2784
  // prettier-ignore
2749
2785
  get $name() {
@@ -2798,50 +2834,13 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
2798
2834
  this.config[type] = configSetters[type](options, this.config[type]);
2799
2835
  return this;
2800
2836
  }
2801
- /** Builds the client by importing modules and registering builtin handlers. */
2802
- async build() {
2803
- this.configure("app", this.config.app);
2804
- this.configure("staff", this.config.staff);
2805
- this.configure("slashCommands", this.config.slashCommands);
2806
- this.configure("prefixCommands", this.config.prefixCommands);
2807
- this.configure("contextCommands", this.config.contextCommands);
2808
- if (this.features.importModules) {
2809
- const importModules = this.features.importModules;
2810
- await Promise.all([
2811
- importModules.events && this.importModules("events", importModules.events),
2812
- importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
2813
- importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
2814
- importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
2815
- ]);
2816
- }
2817
- if (this.features.useDefaultSlashCommandHandler) {
2818
- this.events.register(slashCommandHandler);
2819
- }
2820
- if (this.features.useDefaultContextCommandHandler) {
2821
- this.events.register(contextCommandHandler);
2822
- }
2823
- if (this.features.useDefaultPrefixCommandHandler) {
2824
- this.events.register(prefixCommandHandler);
2825
- }
2826
- return this;
2827
- }
2828
- /**
2829
- * Imports modules into the client.
2830
- * @param type The type of modules to import.
2831
- * @param options The options to import the module with.
2832
- * @param set Replaces already imported modules with the ones found.
2833
- */
2834
- async importModules(type, options, set) {
2835
- await moduleImporters[type](this, options, set);
2836
- return this;
2837
- }
2838
2837
  /**
2839
2838
  * Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
2840
2839
  * @param options Options for dotenv
2841
2840
  * @see https://www.npmjs.com/package/dotenv
2842
2841
  */
2843
2842
  useEnv(options) {
2844
- this.logger.database("Using", "dotenv");
2843
+ this.logger.plugin("ENV", "Using", "dotenv");
2845
2844
  (0, import_dotenv.configDotenv)({ quiet: true, ...options });
2846
2845
  return this;
2847
2846
  }
@@ -2854,6 +2853,16 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
2854
2853
  this.logger.database("Using", db.moduleName);
2855
2854
  return this.db.connect();
2856
2855
  }
2856
+ /**
2857
+ * Imports modules into the client.
2858
+ * @param type The type of modules to import.
2859
+ * @param options The options to import the module with.
2860
+ * @param set Replaces already imported modules with the ones found.
2861
+ */
2862
+ async importModules(type, options, set) {
2863
+ await moduleImporters[type](this, options, set);
2864
+ return this;
2865
+ }
2857
2866
  /**
2858
2867
  * Fetches a user from the client, checking the cache first.
2859
2868
  * @param userId The ID of the user to fetch.