vimcord 1.0.41 → 1.0.43
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 +44 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +44 -43
- 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.42";
|
|
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,11 +1841,11 @@ var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix
|
|
|
1841
1841
|
import_chalk2.default.hex(this.colors.muted)(location)
|
|
1842
1842
|
);
|
|
1843
1843
|
},
|
|
1844
|
-
|
|
1844
|
+
plugin(pluginName, action, details) {
|
|
1845
1845
|
console.log(
|
|
1846
1846
|
this.formatTimestamp(),
|
|
1847
1847
|
this.formatPrefix(),
|
|
1848
|
-
import_chalk2.default.hex("#FF6B9D")(
|
|
1848
|
+
import_chalk2.default.hex("#FF6B9D")(`\u{1F50C} ${pluginName}`),
|
|
1849
1849
|
import_chalk2.default.white(action),
|
|
1850
1850
|
details ? import_chalk2.default.hex(this.colors.muted)(details) : ""
|
|
1851
1851
|
);
|
|
@@ -2737,12 +2737,41 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2737
2737
|
this.status = new StatusManager(this);
|
|
2738
2738
|
this.events = new EventManager(this);
|
|
2739
2739
|
this.commands = new CommandManager(this);
|
|
2740
|
+
this.configure("app", this.config.app);
|
|
2741
|
+
this.logger.clientBanner(this);
|
|
2740
2742
|
this.once("clientReady", (client) => this.logger.clientReady(client.user.tag, client.guilds.cache.size));
|
|
2741
2743
|
_Vimcord.instances.set(this.clientId, this);
|
|
2742
2744
|
if (this.config.app.enableCLI) {
|
|
2743
2745
|
VimcordCLI.setMode("on");
|
|
2744
2746
|
}
|
|
2745
2747
|
}
|
|
2748
|
+
/** Builds the client by importing modules and registering builtin handlers. */
|
|
2749
|
+
async build() {
|
|
2750
|
+
this.configure("app", this.config.app);
|
|
2751
|
+
this.configure("staff", this.config.staff);
|
|
2752
|
+
this.configure("slashCommands", this.config.slashCommands);
|
|
2753
|
+
this.configure("prefixCommands", this.config.prefixCommands);
|
|
2754
|
+
this.configure("contextCommands", this.config.contextCommands);
|
|
2755
|
+
if (this.features.importModules) {
|
|
2756
|
+
const importModules = this.features.importModules;
|
|
2757
|
+
await Promise.all([
|
|
2758
|
+
importModules.events && this.importModules("events", importModules.events),
|
|
2759
|
+
importModules.slashCommands && this.importModules("slashCommands", importModules.slashCommands),
|
|
2760
|
+
importModules.prefixCommands && this.importModules("prefixCommands", importModules.prefixCommands),
|
|
2761
|
+
importModules.contextCommands && this.importModules("contextCommands", importModules.contextCommands)
|
|
2762
|
+
]);
|
|
2763
|
+
}
|
|
2764
|
+
if (this.features.useDefaultSlashCommandHandler) {
|
|
2765
|
+
this.events.register(slashCommandHandler);
|
|
2766
|
+
}
|
|
2767
|
+
if (this.features.useDefaultContextCommandHandler) {
|
|
2768
|
+
this.events.register(contextCommandHandler);
|
|
2769
|
+
}
|
|
2770
|
+
if (this.features.useDefaultPrefixCommandHandler) {
|
|
2771
|
+
this.events.register(prefixCommandHandler);
|
|
2772
|
+
}
|
|
2773
|
+
return this;
|
|
2774
|
+
}
|
|
2746
2775
|
/** Current app name */
|
|
2747
2776
|
// prettier-ignore
|
|
2748
2777
|
get $name() {
|
|
@@ -2797,50 +2826,13 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2797
2826
|
this.config[type] = configSetters[type](options, this.config[type]);
|
|
2798
2827
|
return this;
|
|
2799
2828
|
}
|
|
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
2829
|
/**
|
|
2838
2830
|
* Allows Vimcord to handle environment variables using [dotenv](https://www.npmjs.com/package/dotenv).
|
|
2839
2831
|
* @param options Options for dotenv
|
|
2840
2832
|
* @see https://www.npmjs.com/package/dotenv
|
|
2841
2833
|
*/
|
|
2842
2834
|
useEnv(options) {
|
|
2843
|
-
this.logger.
|
|
2835
|
+
this.logger.plugin("ENV", "Using", "dotenv");
|
|
2844
2836
|
(0, import_dotenv.configDotenv)({ quiet: true, ...options });
|
|
2845
2837
|
return this;
|
|
2846
2838
|
}
|
|
@@ -2850,9 +2842,19 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2850
2842
|
*/
|
|
2851
2843
|
async useDatabase(db) {
|
|
2852
2844
|
this.db = db;
|
|
2853
|
-
this.logger.
|
|
2845
|
+
this.logger.plugin("DATABASE", "Using", db.moduleName);
|
|
2854
2846
|
return this.db.connect();
|
|
2855
2847
|
}
|
|
2848
|
+
/**
|
|
2849
|
+
* Imports modules into the client.
|
|
2850
|
+
* @param type The type of modules to import.
|
|
2851
|
+
* @param options The options to import the module with.
|
|
2852
|
+
* @param set Replaces already imported modules with the ones found.
|
|
2853
|
+
*/
|
|
2854
|
+
async importModules(type, options, set) {
|
|
2855
|
+
await moduleImporters[type](this, options, set);
|
|
2856
|
+
return this;
|
|
2857
|
+
}
|
|
2856
2858
|
/**
|
|
2857
2859
|
* Fetches a user from the client, checking the cache first.
|
|
2858
2860
|
* @param userId The ID of the user to fetch.
|
|
@@ -2880,7 +2882,6 @@ var Vimcord = class _Vimcord extends import_discord11.Client {
|
|
|
2880
2882
|
);
|
|
2881
2883
|
}
|
|
2882
2884
|
await this.build();
|
|
2883
|
-
this.logger.clientBanner(this);
|
|
2884
2885
|
try {
|
|
2885
2886
|
const stopLoader = this.logger.loader("Connecting to Discord...");
|
|
2886
2887
|
const loginResult = await import_qznt4.$.async.retry(() => super.login(token), {
|