reciple 7.0.13 → 7.1.1
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/LICENSE +674 -674
- package/README.md +211 -211
- package/bin/bin.mjs +4 -4
- package/bin/bin.mjs.map +1 -1
- package/bin/classes/Config.d.ts +5 -1
- package/bin/classes/Config.js +3 -2
- package/bin/classes/Config.js.map +1 -1
- package/bin/utils/cli.js +6 -3
- package/bin/utils/cli.js.map +1 -1
- package/bin/utils/logger.js +2 -1
- package/bin/utils/logger.js.map +1 -1
- package/bin/utils/modules.d.ts +2 -1
- package/bin/utils/modules.js +11 -11
- package/bin/utils/modules.js.map +1 -1
- package/package.json +6 -6
- package/static/config.yml +104 -100
package/bin/utils/modules.js
CHANGED
|
@@ -5,24 +5,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.requireTypescriptFile = exports.getModules = void 0;
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
9
8
|
const micromatch_1 = __importDefault(require("micromatch"));
|
|
10
9
|
const cli_1 = require("./cli");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
11
|
async function getModules(config, filter) {
|
|
12
12
|
const modules = [];
|
|
13
13
|
const { globby, isDynamicPattern } = await import('globby');
|
|
14
|
-
if (cli_1.flags?.ts || config.resolveTypescriptModules) {
|
|
15
|
-
require('ts-interpreter.js');
|
|
16
|
-
}
|
|
17
14
|
for (const folder of config.modulesFolders) {
|
|
18
|
-
const dir =
|
|
19
|
-
if (isDynamicPattern(
|
|
20
|
-
let modulesFolders = await globby(
|
|
15
|
+
const dir = path_1.default.isAbsolute(folder) ? folder : path_1.default.join(cli_1.cwd, folder);
|
|
16
|
+
if (isDynamicPattern(folder, { cwd: cli_1.cwd })) {
|
|
17
|
+
let modulesFolders = await globby(folder, {
|
|
21
18
|
cwd: cli_1.cwd,
|
|
22
19
|
onlyDirectories: true,
|
|
23
20
|
absolute: true
|
|
24
21
|
});
|
|
25
|
-
modulesFolders = modulesFolders.filter(f => !micromatch_1.default.isMatch(
|
|
22
|
+
modulesFolders = modulesFolders.filter(f => !micromatch_1.default.isMatch(path_1.default.basename(f), config.exclude));
|
|
26
23
|
modules.push(...await getModules({
|
|
27
24
|
...config,
|
|
28
25
|
modulesFolders
|
|
@@ -33,14 +30,17 @@ async function getModules(config, filter) {
|
|
|
33
30
|
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
34
31
|
if (!(0, fs_1.lstatSync)(dir).isDirectory())
|
|
35
32
|
continue;
|
|
36
|
-
const files = (0, fs_1.readdirSync)(dir).map(file =>
|
|
33
|
+
const files = (0, fs_1.readdirSync)(dir).map(file => path_1.default.join(dir, file)).filter(f => !micromatch_1.default.isMatch(path_1.default.basename(f), config.exclude));
|
|
37
34
|
modules.push(...files.filter(file => (filter ? filter(file) : file.endsWith('.js'))));
|
|
38
35
|
}
|
|
39
36
|
return modules;
|
|
40
37
|
}
|
|
41
38
|
exports.getModules = getModules;
|
|
42
|
-
async function requireTypescriptFile(file) {
|
|
43
|
-
|
|
39
|
+
async function requireTypescriptFile(file, compilerOptions) {
|
|
40
|
+
const tsLoader = await import('@weichwarenprojekt/ts-importer').catch(() => null);
|
|
41
|
+
if (!tsLoader)
|
|
42
|
+
return null;
|
|
43
|
+
return tsLoader.loadModule(file, { compilerOptions });
|
|
44
44
|
}
|
|
45
45
|
exports.requireTypescriptFile = requireTypescriptFile;
|
|
46
46
|
//# sourceMappingURL=modules.js.map
|
package/bin/utils/modules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../src/utils/modules.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAmE;
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../src/utils/modules.ts"],"names":[],"mappings":";;;;;;AAA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,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,oBAAU,CAAC,OAAO,CAAC,cAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACpI,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACzF;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAhCD,gCAgCC;AAEM,KAAK,UAAU,qBAAqB,CAAC,IAAY,EAAE,eAA8D;IACpH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAClF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;AAC1D,CAAC;AALD,sDAKC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Reciple is a Discord.js handler",
|
|
4
4
|
"homepage": "https://reciple.js.org/docs/reciple",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
|
-
"version": "7.
|
|
6
|
+
"version": "7.1.1",
|
|
7
7
|
"main": "./bin/index.js",
|
|
8
8
|
"module": "./bin/esm.mjs",
|
|
9
9
|
"types": "./bin/index.d.ts",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@reciple/client": "^7.0.
|
|
40
|
+
"@reciple/client": "^7.0.9",
|
|
41
|
+
"@weichwarenprojekt/ts-importer": "^0.1.5",
|
|
41
42
|
"chalk": "4.1.2",
|
|
42
43
|
"commander": "^10.0.0",
|
|
43
44
|
"dotenv": "^16.0.3",
|
|
@@ -52,14 +53,13 @@
|
|
|
52
53
|
"@types/micromatch": "^4.0.2",
|
|
53
54
|
"@types/prompts": "^2.4.2",
|
|
54
55
|
"@types/semver": "^7.3.13",
|
|
55
|
-
"discord.js": "^14.7.1"
|
|
56
|
-
"ts-interpreter.js": "^1.4.3"
|
|
56
|
+
"discord.js": "^14.7.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"discord.js": "^14.7.1"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"ts-
|
|
62
|
+
"@weichwarenprojekt/ts-importer": "^0.1.5"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "e6e3b11c7a87cf95d4e11148760dd8777c7050f9"
|
|
65
65
|
}
|
package/static/config.yml
CHANGED
|
@@ -1,100 +1,104 @@
|
|
|
1
|
-
# The bot token
|
|
2
|
-
# You can directly set the bot token as value or use token from env
|
|
3
|
-
# To use token from env set the value like this:
|
|
4
|
-
# token: env:TOKEN
|
|
5
|
-
token: TOKEN
|
|
6
|
-
|
|
7
|
-
# Commands Config
|
|
8
|
-
commands:
|
|
9
|
-
contextMenuCommand:
|
|
10
|
-
# If false, the client will ignore this type of command when executed
|
|
11
|
-
enabled: true
|
|
12
|
-
# Enable user command cooldowns if available
|
|
13
|
-
enableCooldown: true
|
|
14
|
-
# Command register config
|
|
15
|
-
registerCommands:
|
|
16
|
-
# Allow commands to be registered globally
|
|
17
|
-
registerGlobally: true
|
|
18
|
-
# Allow commands to be registered a given guilds/servers
|
|
19
|
-
registerToGuilds: []
|
|
20
|
-
# If enabled, the client will accept replied interactions of this type
|
|
21
|
-
acceptRepliedInteractions: false
|
|
22
|
-
slashCommand:
|
|
23
|
-
# If false, the client will ignore this type of command when executed
|
|
24
|
-
enabled: true
|
|
25
|
-
# Enable user command cooldowns if available
|
|
26
|
-
enableCooldown: true
|
|
27
|
-
# Command register config
|
|
28
|
-
registerCommands:
|
|
29
|
-
# Allow commands to be registered globally
|
|
30
|
-
registerGlobally: true
|
|
31
|
-
# Allow commands to be registered a given guilds/servers
|
|
32
|
-
registerToGuilds: []
|
|
33
|
-
# If enabled, the client will accept replied interactions of this type
|
|
34
|
-
acceptRepliedInteractions: false
|
|
35
|
-
messageCommand:
|
|
36
|
-
# If false, the client will ignore this type of command when executed
|
|
37
|
-
enabled: true
|
|
38
|
-
# Enable user command cooldowns if available
|
|
39
|
-
enableCooldown: true
|
|
40
|
-
# String separator for command options
|
|
41
|
-
commandArgumentSeparator: ' '
|
|
42
|
-
# Command prefix
|
|
43
|
-
prefix: '!'
|
|
44
|
-
additionalApplicationCommands:
|
|
45
|
-
# Command register config
|
|
46
|
-
registerCommands:
|
|
47
|
-
# Allow commands to be registered globally
|
|
48
|
-
registerGlobally: true
|
|
49
|
-
# Allow commands to be registered a given guilds/servers
|
|
50
|
-
registerToGuilds: []
|
|
51
|
-
|
|
52
|
-
# Application commands register config
|
|
53
|
-
applicationCommandRegister:
|
|
54
|
-
# Wether allow all application commands to be registered globally
|
|
55
|
-
# This ignores their specific configs
|
|
56
|
-
allowRegisterGlobally: true
|
|
57
|
-
# Wether allow all application commands to be registered to guilds
|
|
58
|
-
# This ignores their specific configs
|
|
59
|
-
allowRegisterOnGuilds: true
|
|
60
|
-
# Register empty command list
|
|
61
|
-
registerEmptyCommands: true
|
|
62
|
-
|
|
63
|
-
# Logger config
|
|
64
|
-
logger:
|
|
65
|
-
# Enables client logger
|
|
66
|
-
enabled: true
|
|
67
|
-
# Enables logger debug mode
|
|
68
|
-
debugmode: false
|
|
69
|
-
# Enables colored console logs
|
|
70
|
-
coloredMessages: true
|
|
71
|
-
# File file config
|
|
72
|
-
logToFile:
|
|
73
|
-
# Enables log file
|
|
74
|
-
enabled: true
|
|
75
|
-
# Sets the log file folder
|
|
76
|
-
logsFolder: './logs'
|
|
77
|
-
|
|
78
|
-
# Modules config
|
|
79
|
-
modules:
|
|
80
|
-
# Reciple modules folders
|
|
81
|
-
# You can add multiple folders by adding the folder path or using glob patterns
|
|
82
|
-
modulesFolders: ['./modules']
|
|
83
|
-
# Excluded files or folders
|
|
84
|
-
# You can add the file/folder name or use glob patterns
|
|
85
|
-
exclude: []
|
|
86
|
-
# If false, the client will still load unsupported modules
|
|
87
|
-
disableModuleVersionCheck: false
|
|
88
|
-
# Resolve files in modules folder with ".ts" file extension
|
|
89
|
-
# This feature is experimental
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
# The bot token
|
|
2
|
+
# You can directly set the bot token as value or use token from env
|
|
3
|
+
# To use token from env set the value like this:
|
|
4
|
+
# token: env:TOKEN
|
|
5
|
+
token: TOKEN
|
|
6
|
+
|
|
7
|
+
# Commands Config
|
|
8
|
+
commands:
|
|
9
|
+
contextMenuCommand:
|
|
10
|
+
# If false, the client will ignore this type of command when executed
|
|
11
|
+
enabled: true
|
|
12
|
+
# Enable user command cooldowns if available
|
|
13
|
+
enableCooldown: true
|
|
14
|
+
# Command register config
|
|
15
|
+
registerCommands:
|
|
16
|
+
# Allow commands to be registered globally
|
|
17
|
+
registerGlobally: true
|
|
18
|
+
# Allow commands to be registered a given guilds/servers
|
|
19
|
+
registerToGuilds: []
|
|
20
|
+
# If enabled, the client will accept replied interactions of this type
|
|
21
|
+
acceptRepliedInteractions: false
|
|
22
|
+
slashCommand:
|
|
23
|
+
# If false, the client will ignore this type of command when executed
|
|
24
|
+
enabled: true
|
|
25
|
+
# Enable user command cooldowns if available
|
|
26
|
+
enableCooldown: true
|
|
27
|
+
# Command register config
|
|
28
|
+
registerCommands:
|
|
29
|
+
# Allow commands to be registered globally
|
|
30
|
+
registerGlobally: true
|
|
31
|
+
# Allow commands to be registered a given guilds/servers
|
|
32
|
+
registerToGuilds: []
|
|
33
|
+
# If enabled, the client will accept replied interactions of this type
|
|
34
|
+
acceptRepliedInteractions: false
|
|
35
|
+
messageCommand:
|
|
36
|
+
# If false, the client will ignore this type of command when executed
|
|
37
|
+
enabled: true
|
|
38
|
+
# Enable user command cooldowns if available
|
|
39
|
+
enableCooldown: true
|
|
40
|
+
# String separator for command options
|
|
41
|
+
commandArgumentSeparator: ' '
|
|
42
|
+
# Command prefix
|
|
43
|
+
prefix: '!'
|
|
44
|
+
additionalApplicationCommands:
|
|
45
|
+
# Command register config
|
|
46
|
+
registerCommands:
|
|
47
|
+
# Allow commands to be registered globally
|
|
48
|
+
registerGlobally: true
|
|
49
|
+
# Allow commands to be registered a given guilds/servers
|
|
50
|
+
registerToGuilds: []
|
|
51
|
+
|
|
52
|
+
# Application commands register config
|
|
53
|
+
applicationCommandRegister:
|
|
54
|
+
# Wether allow all application commands to be registered globally
|
|
55
|
+
# This ignores their specific configs
|
|
56
|
+
allowRegisterGlobally: true
|
|
57
|
+
# Wether allow all application commands to be registered to guilds
|
|
58
|
+
# This ignores their specific configs
|
|
59
|
+
allowRegisterOnGuilds: true
|
|
60
|
+
# Register empty command list
|
|
61
|
+
registerEmptyCommands: true
|
|
62
|
+
|
|
63
|
+
# Logger config
|
|
64
|
+
logger:
|
|
65
|
+
# Enables client logger
|
|
66
|
+
enabled: true
|
|
67
|
+
# Enables logger debug mode
|
|
68
|
+
debugmode: false
|
|
69
|
+
# Enables colored console logs
|
|
70
|
+
coloredMessages: true
|
|
71
|
+
# File file config
|
|
72
|
+
logToFile:
|
|
73
|
+
# Enables log file
|
|
74
|
+
enabled: true
|
|
75
|
+
# Sets the log file folder
|
|
76
|
+
logsFolder: './logs'
|
|
77
|
+
|
|
78
|
+
# Modules config
|
|
79
|
+
modules:
|
|
80
|
+
# Reciple modules folders
|
|
81
|
+
# You can add multiple folders by adding the folder path or using glob patterns
|
|
82
|
+
modulesFolders: ['./modules']
|
|
83
|
+
# Excluded files or folders
|
|
84
|
+
# You can add the file/folder name or use glob patterns
|
|
85
|
+
exclude: []
|
|
86
|
+
# If false, the client will still load unsupported modules
|
|
87
|
+
disableModuleVersionCheck: false
|
|
88
|
+
# Resolve files in modules folder with ".ts" file extension
|
|
89
|
+
# This feature is experimental
|
|
90
|
+
typescriptModules:
|
|
91
|
+
enabled: false
|
|
92
|
+
compilerOptions:
|
|
93
|
+
target: ESNext
|
|
94
|
+
module: NodeNext
|
|
95
|
+
|
|
96
|
+
# Discord.js client options
|
|
97
|
+
client:
|
|
98
|
+
intents:
|
|
99
|
+
- 'Guilds'
|
|
100
|
+
- 'GuildMessages'
|
|
101
|
+
- 'MessageContent'
|
|
102
|
+
|
|
103
|
+
# Don't change this value
|
|
104
|
+
version: ^VERSION
|