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