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.cjs +49 -40
- 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 +49 -40
- 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.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.
|
|
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({
|
|
@@ -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(),
|
|
@@ -2743,6 +2752,34 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2743
2752
|
VimcordCLI.setMode("on");
|
|
2744
2753
|
}
|
|
2745
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
|
+
}
|
|
2746
2783
|
/** Current app name */
|
|
2747
2784
|
// prettier-ignore
|
|
2748
2785
|
get $name() {
|
|
@@ -2797,50 +2834,13 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2797
2834
|
this.config[type] = configSetters[type](options, this.config[type]);
|
|
2798
2835
|
return this;
|
|
2799
2836
|
}
|
|
2800
|
-
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2801
|
-
async build() {
|
|
2802
|
-
this.configure("app", this.config.app);
|
|
2803
|
-
this.configure("staff", this.config.staff);
|
|
2804
|
-
this.configure("slashCommands", this.config.slashCommands);
|
|
2805
|
-
this.configure("prefixCommands", this.config.prefixCommands);
|
|
2806
|
-
this.configure("contextCommands", this.config.contextCommands);
|
|
2807
|
-
if (this.features.importModules) {
|
|
2808
|
-
const importModules = this.features.importModules;
|
|
2809
|
-
await Promise.all([
|
|
2810
|
-
importModules.events && this.importModules("events", importModules.events),
|
|
2811
|
-
importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
|
|
2812
|
-
importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
|
|
2813
|
-
importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
|
|
2814
|
-
]);
|
|
2815
|
-
}
|
|
2816
|
-
if (this.features.useDefaultSlashCommandHandler) {
|
|
2817
|
-
this.events.register(slashCommandHandler);
|
|
2818
|
-
}
|
|
2819
|
-
if (this.features.useDefaultContextCommandHandler) {
|
|
2820
|
-
this.events.register(contextCommandHandler);
|
|
2821
|
-
}
|
|
2822
|
-
if (this.features.useDefaultPrefixCommandHandler) {
|
|
2823
|
-
this.events.register(prefixCommandHandler);
|
|
2824
|
-
}
|
|
2825
|
-
return this;
|
|
2826
|
-
}
|
|
2827
|
-
/**
|
|
2828
|
-
* Imports modules into the client.
|
|
2829
|
-
* @param type The type of modules to import.
|
|
2830
|
-
* @param options The options to import the module with.
|
|
2831
|
-
* @param set Replaces already imported modules with the ones found.
|
|
2832
|
-
*/
|
|
2833
|
-
async importModules(type, options, set) {
|
|
2834
|
-
await moduleImporters[type](this, options, set);
|
|
2835
|
-
return this;
|
|
2836
|
-
}
|
|
2837
2837
|
/**
|
|
2838
2838
|
* Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
|
|
2839
2839
|
* @param options Options for dotenv
|
|
2840
2840
|
* @see https://www.npmjs.com/package/dotenv
|
|
2841
2841
|
*/
|
|
2842
2842
|
useEnv(options) {
|
|
2843
|
-
this.logger.
|
|
2843
|
+
this.logger.plugin("ENV", "Using", "dotenv");
|
|
2844
2844
|
(0, import_dotenv.configDotenv)({ quiet: true, ...options });
|
|
2845
2845
|
return this;
|
|
2846
2846
|
}
|
|
@@ -2853,6 +2853,16 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2853
2853
|
this.logger.database("Using", db.moduleName);
|
|
2854
2854
|
return this.db.connect();
|
|
2855
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
|
+
}
|
|
2856
2866
|
/**
|
|
2857
2867
|
* Fetches a user from the client, checking the cache first.
|
|
2858
2868
|
* @param userId The ID of the user to fetch.
|
|
@@ -2880,7 +2890,6 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2880
2890
|
);
|
|
2881
2891
|
}
|
|
2882
2892
|
await this.build();
|
|
2883
|
-
this.logger.clientBanner(this);
|
|
2884
2893
|
try {
|
|
2885
2894
|
const stopLoader = this.logger.loader("Connecting to Discord...");
|
|
2886
2895
|
const loginResult = await import_qznt4.$.async.retry(() => super.login(token), {
|