zumito-framework 1.1.53 → 1.1.55
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/ZumitoFramework.js
CHANGED
|
@@ -71,6 +71,7 @@ export class ZumitoFramework {
|
|
|
71
71
|
}
|
|
72
72
|
async initialize() {
|
|
73
73
|
try {
|
|
74
|
+
mongoose.set('strictQuery', true);
|
|
74
75
|
await mongoose.connect(this.settings.mongoQueryString);
|
|
75
76
|
}
|
|
76
77
|
catch (err) {
|
|
@@ -141,11 +142,11 @@ export class ZumitoFramework {
|
|
|
141
142
|
async registerModule(modulesFolder, moduleName, module) {
|
|
142
143
|
if (!module) {
|
|
143
144
|
if (fs.existsSync(path.join(modulesFolder, moduleName, 'index.js'))) {
|
|
144
|
-
module = await import(path.join(modulesFolder, moduleName, 'index.js'));
|
|
145
|
+
module = await import('file://' + path.join(modulesFolder, moduleName, 'index.js'));
|
|
145
146
|
module = Object.values(module)[0];
|
|
146
147
|
}
|
|
147
148
|
else if (fs.existsSync(path.join(modulesFolder, moduleName, 'index.ts'))) {
|
|
148
|
-
module = await import(path.join(modulesFolder, moduleName, 'index.ts'));
|
|
149
|
+
module = await import('file://' + path.join(modulesFolder, moduleName, 'index.ts'));
|
|
149
150
|
module = Object.values(module)[0];
|
|
150
151
|
}
|
|
151
152
|
else {
|
|
@@ -213,7 +213,7 @@ export class MessageCreate extends FrameworkEvent {
|
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
const body = `\n\n\n---\nComand:\`\`\`${error.command.name || 'not defined'}\`\`\`\nArguments:\`\`\`${error.args.toString() || 'none'}\`\`\`\nError:\`\`\`${error.name || 'not defined'}\`\`\`\nError message:\`\`\`${error.message || 'not defined'}\`\`\`\n`;
|
|
216
|
-
const requestUrl = `https://github.com/
|
|
216
|
+
const requestUrl = `https://github.com/ZumitoTeam/Zumito/issues/new?body=${encodeURIComponent(body)}`;
|
|
217
217
|
const row = new ActionRowBuilder()
|
|
218
218
|
.addComponents(new ButtonBuilder()
|
|
219
219
|
.setStyle(ButtonStyle.Link)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zumito-framework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.55",
|
|
4
4
|
"description": "Discord.js bot framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
18
18
|
"build": "tsc",
|
|
19
|
+
"lint": "eslint .",
|
|
19
20
|
"publish-npm": "npm publish",
|
|
20
21
|
"docs": "typedoc --out docs src"
|
|
21
22
|
},
|
|
@@ -39,6 +40,12 @@
|
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@types/node": "^18.7.16",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
|
44
|
+
"@typescript-eslint/parser": "^5.48.2",
|
|
45
|
+
"eslint": "^8.32.0",
|
|
46
|
+
"eslint-config-prettier": "^8.6.0",
|
|
47
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
48
|
+
"prettier": "^2.8.3",
|
|
42
49
|
"typedoc": "^0.23.14",
|
|
43
50
|
"typescript": "^4.8.3"
|
|
44
51
|
},
|
package/plopfile.js
CHANGED
|
@@ -1,89 +1,116 @@
|
|
|
1
1
|
module.exports = function (plop) {
|
|
2
|
-
|
|
2
|
+
plop.setHelper('capitalize', function (text) {
|
|
3
3
|
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
5
|
+
// create your generators here
|
|
6
|
+
plop.setGenerator('command', {
|
|
7
|
+
description: 'this is a skeleton command file',
|
|
8
|
+
prompts: [
|
|
9
|
+
{
|
|
10
|
+
type: 'input',
|
|
11
|
+
name: 'module',
|
|
12
|
+
message: 'Name of the module',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: 'input',
|
|
16
|
+
name: 'command',
|
|
17
|
+
message: 'Name of the command',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
actions: [
|
|
21
|
+
{
|
|
22
|
+
type: 'add',
|
|
23
|
+
path: 'src/modules/{{module}}/commands/{{command}}.js',
|
|
24
|
+
templateFile: 'plop-templates/command.js.hbs',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
plop.setGenerator('translation', {
|
|
29
|
+
description: 'This generate translation file for a module',
|
|
30
|
+
prompts: [
|
|
31
|
+
{
|
|
32
|
+
type: 'input',
|
|
33
|
+
name: 'module',
|
|
34
|
+
message: 'Name of the module',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'choice',
|
|
38
|
+
name: 'language',
|
|
39
|
+
message: 'Language of the translations',
|
|
40
|
+
choices: [
|
|
41
|
+
{
|
|
42
|
+
name: 'English',
|
|
43
|
+
value: 'en',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Spanish',
|
|
47
|
+
value: 'es',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'French',
|
|
51
|
+
value: 'fr',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'German',
|
|
55
|
+
value: 'de',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Italian',
|
|
59
|
+
value: 'it',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'Portuguese',
|
|
63
|
+
value: 'pt',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Russian',
|
|
67
|
+
value: 'ru',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Turkish',
|
|
71
|
+
value: 'tr',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Chinese',
|
|
75
|
+
value: 'zh',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Japanese',
|
|
79
|
+
value: 'ja',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Korean',
|
|
83
|
+
value: 'ko',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Polish',
|
|
87
|
+
value: 'pl',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Romanian',
|
|
91
|
+
value: 'ro',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'Russian',
|
|
95
|
+
value: 'ru',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'Ukrainian',
|
|
99
|
+
value: 'uk',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'Vietnamese',
|
|
103
|
+
value: 'vi',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
actions: [
|
|
109
|
+
{
|
|
110
|
+
type: 'add',
|
|
111
|
+
path: 'src/modules/{{module}}/translations/{{language}}.json',
|
|
112
|
+
templateFile: 'plop-templates/translation.json.hbs',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
});
|
|
116
|
+
};
|
package/templateGenerator.mjs
CHANGED
|
File without changes
|