myt/lib/command.js

20 lines
409 B
JavaScript
Raw Permalink Normal View History

/**
2022-12-21 13:17:50 +00:00
* Base class for Myt commands.
*/
2022-12-21 13:17:50 +00:00
module.exports = class MytCommand {
constructor(myt, opts) {
this.myt = myt;
this.opts = opts;
}
2022-12-21 13:17:50 +00:00
async run(myt, opts) {
throw new Error('run command not defined');
}
emit(event) {
const messages = this.constructor.messages;
if (messages && messages[event])
console.log(messages[event]);
}
}