zumito-framework 1.1.62 → 1.1.64

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.
@@ -56,48 +56,26 @@ 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 ' +
61
- chalk.blue(filePath
62
- .replace(/^.*[\\\/]/, '')
63
- .split('.')
64
- .slice(0, -1)
65
- .join('.')));
59
+ let command = await import('file://' + filePath).catch(e => {
60
+ console.error('[🆕🔴 ] Error loading command ' + chalk.blue(filePath.replace(/^.*[\\\/]/, '').split('.').slice(0, -1).join('.')));
66
61
  console.log(e + '\n' + e.name + '\n' + e.stack);
67
62
  });
68
63
  command = Object.values(command)[0];
69
64
  command = new 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');
65
+ this.framework.commands.set(command.constructor.name.toLowerCase(), command);
66
+ console.debug('[🆕🟢 ] Command ' + chalk.blue(filePath.replace(/^.*[\\\/]/, '').split('.').slice(0, -1).join('.')) + ' loaded');
78
67
  }
79
68
  }
80
69
  async onCommandChanged(filePath) {
81
70
  if (filePath.endsWith('.js') || filePath.endsWith('.ts')) {
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('.')));
71
+ let command = await import('file://' + filePath + '?update=' + Date.now().toString()).catch(e => {
72
+ console.error('[🔄🔴 ] Error reloading command ' + chalk.blue(filePath.replace(/^.*[\\\/]/, '').split('.').slice(0, -1).join('.')));
89
73
  console.log(boxen(e + '\n' + e.name + '\n' + e.stack, { padding: 1 }));
90
74
  });
91
75
  command = Object.values(command)[0];
92
76
  command = new 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');
77
+ this.framework.commands.set(command.constructor.name.toLowerCase(), command);
78
+ console.debug('[🔄🟢 ] Command ' + chalk.blue(filePath.replace(/^.*[\\\/]/, '').split('.').slice(0, -1).join('.')) + ' reloaded');
101
79
  }
102
80
  }
103
81
  onErrorLoadingCommand(error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zumito-framework",
3
- "version": "1.1.62",
3
+ "version": "1.1.64",
4
4
  "description": "Discord.js bot framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",