utilitas 1995.2.39 → 1995.2.40
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/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/bot.mjs +4 -4
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/bot.mjs
CHANGED
|
@@ -247,7 +247,7 @@ const subconscious = [{
|
|
|
247
247
|
};
|
|
248
248
|
ctx.er = async (m, opts) => {
|
|
249
249
|
log(m);
|
|
250
|
-
return await ctx.ok(m?.message || m
|
|
250
|
+
return await ctx.ok(`⚠️ ${m?.message || m}`, opts);
|
|
251
251
|
};
|
|
252
252
|
ctx.complete = async (options) => await ctx.ok('☑️', options);
|
|
253
253
|
ctx.json = async (obj, options) => await ctx.ok(json(obj), options);
|
|
@@ -638,7 +638,7 @@ const subconscious = [{
|
|
|
638
638
|
},
|
|
639
639
|
}];
|
|
640
640
|
|
|
641
|
-
const
|
|
641
|
+
const establish = (bot, module, options) => {
|
|
642
642
|
if (!module.run) { return; }
|
|
643
643
|
assert(module?.func, 'Skill function is required.', 500);
|
|
644
644
|
bot._.skills[module.name || (module.name = uuidv4())] = {
|
|
@@ -653,7 +653,7 @@ const train = (bot, module, options) => {
|
|
|
653
653
|
newCommand(command, module[sub][command])
|
|
654
654
|
));
|
|
655
655
|
}
|
|
656
|
-
log(`
|
|
656
|
+
log(`Establishing: ${module.name} (${module.priority})`, { force: true });
|
|
657
657
|
return bot.use(countKeys(module.cmds) && !module.cmdx ? async (ctx, next) => {
|
|
658
658
|
for (let c in module.cmds) {
|
|
659
659
|
if (insensitiveCompare(ctx.cmd?.cmd, c)) {
|
|
@@ -723,7 +723,7 @@ const init = async (options) => {
|
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
mods.sort((x, y) => ~~x.priority - ~~y.priority).map(
|
|
726
|
-
module =>
|
|
726
|
+
module => establish(bot, module, options)
|
|
727
727
|
);
|
|
728
728
|
assert(mods.length, 'Invalid skill set.', 501);
|
|
729
729
|
parseArgs(); // Validate args options.
|
package/lib/manifest.mjs
CHANGED