zumito-framework 1.1.61 → 1.1.62
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/types/Module.js +30 -8
- package/package.json +2 -1
package/dist/types/Module.js
CHANGED
|
@@ -56,26 +56,48 @@ export class Module {
|
|
|
56
56
|
}
|
|
57
57
|
async onCommandCreated(filePath) {
|
|
58
58
|
if (filePath.endsWith('.js') || filePath.endsWith('.ts')) {
|
|
59
|
-
let command = await import('file://' + filePath).catch(e => {
|
|
60
|
-
console.error('[🆕🔴 ] Error loading command ' +
|
|
59
|
+
let command = await import('file://' + filePath).catch((e) => {
|
|
60
|
+
console.error('[🆕🔴 ] Error loading command ' +
|
|
61
|
+
chalk.blue(filePath
|
|
62
|
+
.replace(/^.*[\\\/]/, '')
|
|
63
|
+
.split('.')
|
|
64
|
+
.slice(0, -1)
|
|
65
|
+
.join('.')));
|
|
61
66
|
console.log(e + '\n' + e.name + '\n' + e.stack);
|
|
62
67
|
});
|
|
63
68
|
command = Object.values(command)[0];
|
|
64
69
|
command = new command();
|
|
65
|
-
this.
|
|
66
|
-
console.debug('[🆕🟢 ] Command ' +
|
|
70
|
+
this.commands.set(command.constructor.name.toLowerCase(), command);
|
|
71
|
+
console.debug('[🆕🟢 ] Command ' +
|
|
72
|
+
chalk.blue(filePath
|
|
73
|
+
.replace(/^.*[\\\/]/, '')
|
|
74
|
+
.split('.')
|
|
75
|
+
.slice(0, -1)
|
|
76
|
+
.join('.')) +
|
|
77
|
+
' loaded');
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
80
|
async onCommandChanged(filePath) {
|
|
70
81
|
if (filePath.endsWith('.js') || filePath.endsWith('.ts')) {
|
|
71
|
-
let command = await import('file://' + filePath + '?update=' + Date.now().toString()).catch(e => {
|
|
72
|
-
console.error('[🔄🔴 ] Error reloading command ' +
|
|
82
|
+
let command = await import('file://' + filePath + '?update=' + Date.now().toString()).catch((e) => {
|
|
83
|
+
console.error('[🔄🔴 ] Error reloading command ' +
|
|
84
|
+
chalk.blue(filePath
|
|
85
|
+
.replace(/^.*[\\\/]/, '')
|
|
86
|
+
.split('.')
|
|
87
|
+
.slice(0, -1)
|
|
88
|
+
.join('.')));
|
|
73
89
|
console.log(boxen(e + '\n' + e.name + '\n' + e.stack, { padding: 1 }));
|
|
74
90
|
});
|
|
75
91
|
command = Object.values(command)[0];
|
|
76
92
|
command = new command();
|
|
77
|
-
this.
|
|
78
|
-
console.debug('[🔄🟢 ] Command ' +
|
|
93
|
+
this.commands.set(command.constructor.name.toLowerCase(), command);
|
|
94
|
+
console.debug('[🔄🟢 ] Command ' +
|
|
95
|
+
chalk.blue(filePath
|
|
96
|
+
.replace(/^.*[\\\/]/, '')
|
|
97
|
+
.split('.')
|
|
98
|
+
.slice(0, -1)
|
|
99
|
+
.join('.')) +
|
|
100
|
+
' reloaded');
|
|
79
101
|
}
|
|
80
102
|
}
|
|
81
103
|
onErrorLoadingCommand(error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zumito-framework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.62",
|
|
4
4
|
"description": "Discord.js bot framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"author": "fernandomema",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@discordjs/rest": "^1.7.0",
|
|
22
23
|
"@types/express": "^4.17.13",
|
|
23
24
|
"autocorrect": "^1.2.0",
|
|
24
25
|
"better-logging": "^5.0.0",
|