await a promise
This commit is contained in:
parent
09a3931d88
commit
26b397d33d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user