From 0a0a5f13859603091c87f9fbabf719a72e7f0f22 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sat, 23 Jul 2022 21:07:00 +0300 Subject: [PATCH] bugfix --- src/middleware/shard/Shard.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/middleware/shard/Shard.js b/src/middleware/shard/Shard.js index 62c68ef..dc60b4b 100644 --- a/src/middleware/shard/Shard.js +++ b/src/middleware/shard/Shard.js @@ -1,8 +1,9 @@ /* Adopted from Discord.js v13 */ const { EventEmitter } = require('events'); -const { Util } = require('discord.js'); +const { makePlainError, makeError } = require('discord.js'); const path = require('path'); +const { Util } = require('../../utilities'); let childProcess = null; let Worker = null; @@ -179,7 +180,7 @@ class Shard extends EventEmitter { child.removeListener('message', listener); this._evals.delete(_eval); if (!message._error) resolve(message._result); - else reject(Util.makeError(message._error)); + else reject(makeError(message._error)); }; child.on('message', listener); @@ -218,7 +219,7 @@ class Shard extends EventEmitter { const resp = { _sFetchProp: message._sFetchProp, _sFetchPropShard: message._sFetchPropShard }; this.manager.fetchClientValues(message._sFetchProp, message._sFetchPropShard).then( (results) => this.send({ ...resp, _result: results }), - (error) => this.send({ ...resp, _error: Util.makePlainError(error) }) + (error) => this.send({ ...resp, _error: makePlainError(error) }) ); return; } @@ -227,7 +228,7 @@ class Shard extends EventEmitter { const resp = { _sEval: message._sEval, _sEvalShard: message._sEvalShard }; this.manager._performOnShards('eval', [message._sEval], message._sEvalShard).then( (results) => this.send({ ...resp, _result: results }), - (error) => this.send({ ...resp, _error: Util.makePlainError(error) }) + (error) => this.send({ ...resp, _error: makePlainError(error) }) ); return; }