vimcord 1.0.37 → 1.0.38
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 +17 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +17 -11
- 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
|
@@ -1753,7 +1753,7 @@ var ErrorHandler = class {
|
|
|
1753
1753
|
var import_chalk2 = __toESM(require("chalk"));
|
|
1754
1754
|
|
|
1755
1755
|
// package.json
|
|
1756
|
-
var version = "1.0.
|
|
1756
|
+
var version = "1.0.38";
|
|
1757
1757
|
|
|
1758
1758
|
// src/client/vimcord.logger.ts
|
|
1759
1759
|
var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix: `vimcord (i${client.clientId})` }).extend({
|
|
@@ -1896,31 +1896,31 @@ var configSetters = {
|
|
|
1896
1896
|
app: createAppConfig,
|
|
1897
1897
|
staff: createStaffConfig,
|
|
1898
1898
|
slashCommands: createSlashCommandConfig,
|
|
1899
|
-
|
|
1900
|
-
|
|
1899
|
+
contextCommands: createContextCommandConfig,
|
|
1900
|
+
prefixCommands: createPrefixCommandConfig
|
|
1901
1901
|
};
|
|
1902
1902
|
var moduleImporters = {
|
|
1903
1903
|
slashCommands: (client, options, set) => {
|
|
1904
1904
|
const opt = options;
|
|
1905
|
-
const dir = Array.isArray(options) ? options :
|
|
1905
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1906
1906
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.slashCommands : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.slashCommands;
|
|
1907
1907
|
return client.commands.slash.importFrom(dir, set, suffix);
|
|
1908
1908
|
},
|
|
1909
1909
|
contextCommands: (client, options, set) => {
|
|
1910
1910
|
const opt = options;
|
|
1911
|
-
const dir = Array.isArray(options) ? options :
|
|
1911
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1912
1912
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.contextCommands : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.contextCommands;
|
|
1913
1913
|
return client.commands.context.importFrom(dir, set, suffix);
|
|
1914
1914
|
},
|
|
1915
1915
|
prefixCommands: (client, options, set) => {
|
|
1916
1916
|
const opt = options;
|
|
1917
|
-
const dir = Array.isArray(options) ? options :
|
|
1917
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1918
1918
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.prefixCommands : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.prefixCommands;
|
|
1919
1919
|
return client.commands.prefix.importFrom(dir, set, suffix);
|
|
1920
1920
|
},
|
|
1921
1921
|
events: (client, options, set) => {
|
|
1922
1922
|
const opt = options;
|
|
1923
|
-
const dir = Array.isArray(options) ? options :
|
|
1923
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1924
1924
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.events : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.events;
|
|
1925
1925
|
return client.events.importFrom(dir, set, suffix);
|
|
1926
1926
|
}
|
|
@@ -1940,9 +1940,15 @@ function defineVimcordConfig(config) {
|
|
|
1940
1940
|
contextCommands: createContextCommandConfig(config.contextCommands)
|
|
1941
1941
|
};
|
|
1942
1942
|
}
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1943
|
+
function useClient(clientId) {
|
|
1944
|
+
return Vimcord.getInstance(clientId);
|
|
1945
|
+
}
|
|
1946
|
+
function useReadyClient(clientId, timeoutMs) {
|
|
1947
|
+
return Vimcord.getReadyInstance(clientId, timeoutMs);
|
|
1948
|
+
}
|
|
1949
|
+
function createClient(options, features, config) {
|
|
1950
|
+
return Vimcord.create(options, features, config);
|
|
1951
|
+
}
|
|
1946
1952
|
|
|
1947
1953
|
// src/modules/command.manager.ts
|
|
1948
1954
|
var import_discord8 = require("discord.js");
|
|
@@ -1959,7 +1965,7 @@ async function importModulesFromDir(dir, suffix) {
|
|
|
1959
1965
|
const cwd = getProcessDir();
|
|
1960
1966
|
const MODULE_RELATIVE_PATH = import_node_path2.default.join(cwd, dir);
|
|
1961
1967
|
const MODULE_LOG_PATH = dir;
|
|
1962
|
-
const files = import_qznt.$.fs.readDir(MODULE_RELATIVE_PATH).filter((fn) => fn.endsWith(`${suffix ?
|
|
1968
|
+
const files = import_qznt.$.fs.readDir(MODULE_RELATIVE_PATH).filter((fn) => fn.endsWith(`${suffix ? `${suffix}` : ""}.js`) || fn.endsWith(`${suffix ? `${suffix}` : ""}.ts`));
|
|
1963
1969
|
if (!files.length) {
|
|
1964
1970
|
return [];
|
|
1965
1971
|
}
|