modmail/structure/Command.js

21 lines
390 B
JavaScript
Raw Normal View History

2021-06-18 15:41:57 +02:00
class Command {
2021-10-22 09:35:04 +02:00
constructor (client, options) {
2021-06-18 15:41:57 +02:00
2021-10-22 09:35:04 +02:00
Object.entries(options).forEach(([ key, val ]) => {
2021-06-18 15:41:57 +02:00
this[key] = val;
});
if (!this.name) throw new Error(`Missing name for command`);
this.client = client;
}
2021-10-22 09:35:04 +02:00
async execute () {
2021-06-18 15:41:57 +02:00
throw new Error(`Missing execute in ${this.name}`);
}
}
module.exports = Command;