mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix(ShardClientUtil): send method erroneously rejecting (#2604)
This commit is contained in:
parent
d97af9d2e0
commit
c5fea45f30
1 changed files with 1 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
|||
const Util = require('../util/Util');
|
||||
const { Events } = require('../util/Constants');
|
||||
const { Error } = require('../errors');
|
||||
|
||||
/**
|
||||
* Helper class for sharded clients spawned as a child process, such as from a {@link ShardingManager}.
|
||||
|
|
@ -43,10 +42,9 @@ class ShardClientUtil {
|
|||
*/
|
||||
send(message) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const sent = process.send(message, err => {
|
||||
process.send(message, err => {
|
||||
if (err) reject(err); else resolve();
|
||||
});
|
||||
if (!sent) throw new Error('SHARDING_PARENT_CONNECTION');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue