reciple 9.7.1 → 9.9.0
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/classes/CLI.d.ts
CHANGED
|
@@ -50,6 +50,6 @@ export declare class CLI implements CLIOptions {
|
|
|
50
50
|
sendProcessInfo(): Promise<void>;
|
|
51
51
|
protected preActionHandler(command: Command, action: Command): void;
|
|
52
52
|
static stringifyFlags(flags: OptionValues, command: Command, ignored?: string[]): string[];
|
|
53
|
-
static run(script: string, options?: ExecSyncOptions): string | Buffer
|
|
53
|
+
static run(script: string, options?: ExecSyncOptions): string | Buffer<ArrayBufferLike>;
|
|
54
54
|
static clearConsole(): void;
|
|
55
55
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { kleur } from 'fallout-utility';
|
|
2
|
-
import micromatch from 'micromatch';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { existsAsync } from '@reciple/utils';
|
|
5
4
|
import { lstat, mkdir, readdir } from 'node:fs/promises';
|
|
@@ -15,14 +14,12 @@ export class ModuleLoader {
|
|
|
15
14
|
for (const folder of options.config.dirs) {
|
|
16
15
|
const folderPath = path.isAbsolute(folder) ? folder : path.join(cwd, folder);
|
|
17
16
|
if (isDynamicPattern(folder, { cwd })) {
|
|
18
|
-
|
|
17
|
+
const dirs = await globby(folder, {
|
|
19
18
|
cwd: process.cwd(),
|
|
20
19
|
onlyDirectories: true,
|
|
21
|
-
absolute: true
|
|
20
|
+
absolute: true,
|
|
21
|
+
ignore: options.config.exclude
|
|
22
22
|
});
|
|
23
|
-
if (options.config?.exclude?.length) {
|
|
24
|
-
dirs = dirs.filter(f => !micromatch.isMatch(path.basename(f), options.config.exclude));
|
|
25
|
-
}
|
|
26
23
|
paths.push(...await ModuleLoader.getModulePaths({
|
|
27
24
|
...options,
|
|
28
25
|
config: {
|
|
@@ -39,7 +36,6 @@ export class ModuleLoader {
|
|
|
39
36
|
const files = (await readdir(folderPath))
|
|
40
37
|
.map(file => path
|
|
41
38
|
.join(folderPath, file))
|
|
42
|
-
.filter(f => !options.config?.exclude?.length || !micromatch.isMatch(path.basename(f), options.config.exclude))
|
|
43
39
|
.filter(file => (options.filter ? options.filter(file) : ModuleLoader.defaultModulePathsFilter(file)));
|
|
44
40
|
await Promise.all(files.map(async (f) => {
|
|
45
41
|
if (options.config.filter) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleLoader.js","sourceRoot":"","sources":["../../src/classes/ModuleLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,
|
|
1
|
+
{"version":3,"file":"ModuleLoader.js","sourceRoot":"","sources":["../../src/classes/ModuleLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAa3D,MAAM,OAAO,YAAY;IACd,MAAM,CAAC,MAAM,CAA2B;IACxC,MAAM,CAAC,QAAQ,GAAY,KAAK,CAAC;IAExC,gBAAuB,CAAC;IAEjB,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,OAA0C;QACzE,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,EAAE,CAAC;QACpE,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAE1C,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACvC,MAAM,UA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C;QACrE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC;QAEtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,IAAY;QAC/C,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,SAAS;QACzB,IAAI,YAAY,CAAC,MAAM;YAAE,OAAO,YAAY,CAAC,MAAM,CAAC;QAEpD,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Reciple is a Discord.js bot framework",
|
|
4
4
|
"homepage": "https://reciple.js.org/docs/reciple",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
|
-
"version": "9.
|
|
6
|
+
"version": "9.9.0",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"bin": "./dist/bin.js",
|
|
@@ -42,28 +42,25 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@reciple/utils": "^9.
|
|
45
|
+
"@reciple/utils": "^9.8.0",
|
|
46
46
|
"ansi-regex": "^6.1.0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"dotenv": "^16.4.5",
|
|
47
|
+
"commander": "^13.1.0",
|
|
48
|
+
"dotenv": "^16.4.7",
|
|
50
49
|
"fallout-utility": "^2.9.1",
|
|
51
|
-
"globby": "^14.0
|
|
52
|
-
"micromatch": "^4.0.8",
|
|
53
|
-
"nodemon": "^3.1.4",
|
|
50
|
+
"globby": "^14.1.0",
|
|
54
51
|
"prompts": "^2.4.2",
|
|
55
52
|
"prtyprnt": "^1.1.0",
|
|
56
|
-
"semver": "^7.
|
|
53
|
+
"semver": "^7.7.1"
|
|
57
54
|
},
|
|
58
55
|
"devDependencies": {
|
|
59
|
-
"@reciple/core": "^9.
|
|
56
|
+
"@reciple/core": "^9.9.0",
|
|
60
57
|
"@types/micromatch": "^4.0.9",
|
|
61
58
|
"@types/semver": "^7.5.8",
|
|
62
|
-
"discord.js": "^14.
|
|
59
|
+
"discord.js": "^14.18.0"
|
|
63
60
|
},
|
|
64
61
|
"peerDependencies": {
|
|
65
62
|
"@reciple/core": "^9 || ^9.0.0-dev",
|
|
66
63
|
"discord.js": "^14.15.0"
|
|
67
64
|
},
|
|
68
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ff4612a6d5c11540f45cdaeb1e3a01f5cbf952d8"
|
|
69
66
|
}
|
package/static/config.mjs
CHANGED
|
@@ -12,33 +12,45 @@ export const config = {
|
|
|
12
12
|
contextMenuCommand: {
|
|
13
13
|
enabled: true,
|
|
14
14
|
enableCooldown: true,
|
|
15
|
+
// Accepts interactions that are replied when enabled
|
|
15
16
|
acceptRepliedInteractions: false,
|
|
16
17
|
registerCommands: {
|
|
18
|
+
// Register all context menu commands globally
|
|
17
19
|
registerGlobally: true,
|
|
20
|
+
// Register context menu commands to specific guilds
|
|
18
21
|
registerToGuilds: []
|
|
19
22
|
}
|
|
20
23
|
},
|
|
21
24
|
messageCommand: {
|
|
22
25
|
enabled: true,
|
|
23
26
|
enableCooldown: true,
|
|
27
|
+
// Character that separates the command arguments in message commands
|
|
24
28
|
commandArgumentSeparator: ' ',
|
|
29
|
+
// Prefix that will trigger a certain message commands
|
|
25
30
|
prefix: '!'
|
|
26
31
|
},
|
|
27
32
|
slashCommand: {
|
|
28
33
|
enabled: true,
|
|
29
34
|
enableCooldown: true,
|
|
35
|
+
// Accepts interactions that are replied when enabled
|
|
30
36
|
acceptRepliedInteractions: false,
|
|
31
37
|
registerCommands: {
|
|
38
|
+
// Register all slash commands globally
|
|
32
39
|
registerGlobally: true,
|
|
40
|
+
// Register slash commands to specific guilds
|
|
33
41
|
registerToGuilds: []
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
},
|
|
37
45
|
applicationCommandRegister: {
|
|
38
46
|
enabled: true,
|
|
47
|
+
// Allow register all commands globally
|
|
39
48
|
allowRegisterGlobally: true,
|
|
49
|
+
// Allow register all commands to guilds
|
|
40
50
|
allowRegisterToGuilds: true,
|
|
51
|
+
// Allow empty commands to be registered
|
|
41
52
|
registerEmptyCommands: true,
|
|
53
|
+
// Register all commands to specific guilds
|
|
42
54
|
registerToGuilds: []
|
|
43
55
|
},
|
|
44
56
|
client: {
|
|
@@ -61,9 +73,13 @@ export const config = {
|
|
|
61
73
|
}
|
|
62
74
|
},
|
|
63
75
|
modules: {
|
|
76
|
+
// Directories to load modules from
|
|
64
77
|
dirs: ['./modules', './modules/*', './modules/*/*'],
|
|
65
|
-
exclude
|
|
78
|
+
// Directories to exclude from loading modules
|
|
79
|
+
exclude: ['./modules/halts', './modules/preconditions', './modules/_*'],
|
|
80
|
+
// Custom filter for loading modules
|
|
66
81
|
filter: file => true,
|
|
82
|
+
// Disable module version check when loading modules
|
|
67
83
|
disableModuleVersionCheck: false
|
|
68
84
|
},
|
|
69
85
|
preconditions: [
|
|
@@ -72,9 +88,12 @@ export const config = {
|
|
|
72
88
|
],
|
|
73
89
|
commandHalts: [],
|
|
74
90
|
cooldownSweeperOptions: {
|
|
91
|
+
// Time in milliseconds to check for expired cooldowns
|
|
75
92
|
timer: 1000 * 60 * 60
|
|
76
93
|
},
|
|
94
|
+
// Announce reciple updates when the bot starts
|
|
77
95
|
checkForUpdates: true,
|
|
96
|
+
// The version of the CLI that was used to generate the project
|
|
78
97
|
version: `^${cliVersion}`
|
|
79
98
|
};
|
|
80
99
|
|