forked from Galactic/galactic-bot
bugfix
This commit is contained in:
parent
5f646f3321
commit
0a0a5f1385
@ -1,8 +1,9 @@
|
|||||||
/* Adopted from Discord.js v13 */
|
/* Adopted from Discord.js v13 */
|
||||||
|
|
||||||
const { EventEmitter } = require('events');
|
const { EventEmitter } = require('events');
|
||||||
const { Util } = require('discord.js');
|
const { makePlainError, makeError } = require('discord.js');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const { Util } = require('../../utilities');
|
||||||
|
|
||||||
let childProcess = null;
|
let childProcess = null;
|
||||||
let Worker = null;
|
let Worker = null;
|
||||||
@ -179,7 +180,7 @@ class Shard extends EventEmitter {
|
|||||||
child.removeListener('message', listener);
|
child.removeListener('message', listener);
|
||||||
this._evals.delete(_eval);
|
this._evals.delete(_eval);
|
||||||
if (!message._error) resolve(message._result);
|
if (!message._error) resolve(message._result);
|
||||||
else reject(Util.makeError(message._error));
|
else reject(makeError(message._error));
|
||||||
};
|
};
|
||||||
child.on('message', listener);
|
child.on('message', listener);
|
||||||
|
|
||||||
@ -218,7 +219,7 @@ class Shard extends EventEmitter {
|
|||||||
const resp = { _sFetchProp: message._sFetchProp, _sFetchPropShard: message._sFetchPropShard };
|
const resp = { _sFetchProp: message._sFetchProp, _sFetchPropShard: message._sFetchPropShard };
|
||||||
this.manager.fetchClientValues(message._sFetchProp, message._sFetchPropShard).then(
|
this.manager.fetchClientValues(message._sFetchProp, message._sFetchPropShard).then(
|
||||||
(results) => this.send({ ...resp, _result: results }),
|
(results) => this.send({ ...resp, _result: results }),
|
||||||
(error) => this.send({ ...resp, _error: Util.makePlainError(error) })
|
(error) => this.send({ ...resp, _error: makePlainError(error) })
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -227,7 +228,7 @@ class Shard extends EventEmitter {
|
|||||||
const resp = { _sEval: message._sEval, _sEvalShard: message._sEvalShard };
|
const resp = { _sEval: message._sEval, _sEvalShard: message._sEvalShard };
|
||||||
this.manager._performOnShards('eval', [message._sEval], message._sEvalShard).then(
|
this.manager._performOnShards('eval', [message._sEval], message._sEvalShard).then(
|
||||||
(results) => this.send({ ...resp, _result: results }),
|
(results) => this.send({ ...resp, _result: results }),
|
||||||
(error) => this.send({ ...resp, _error: Util.makePlainError(error) })
|
(error) => this.send({ ...resp, _error: makePlainError(error) })
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user