await a promise

This commit is contained in:
Erik 2022-01-15 02:23:12 +02:00
parent 09a3931d88
commit 26b397d33d
No known key found for this signature in database
GPG Key ID: FEFF4B220DDF5589

View File

@ -73,8 +73,7 @@ class CommandHandler extends Observer {
async _executeCommand(thing, options) { async _executeCommand(thing, options) {
try { try {
const resolved = thing.command.execute(thing, options); await thing.command.execute(thing, options);
if(resolved instanceof Promise) await resolved;
} catch(error) { } catch(error) {
this.client.logger.error(error.stack || error); this.client.logger.error(error.stack || error);
this._generateError(thing); this._generateError(thing);