mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix(Shard): erroneously returning false
The node documentation fails to correctly document when the backlog of unsent messages exceeds a certain threshhold the function will return false. This does not mean it will refuse to send- simply that it will take time. Issue in point: https://github.com/nodejs/node/issues/7657#issuecomment-240581726
This commit is contained in:
parent
c699888780
commit
eef4a4ad17
1 changed files with 1 additions and 2 deletions
|
|
@ -57,10 +57,9 @@ class Shard {
|
|||
*/
|
||||
send(message) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const sent = this.process.send(message, err => {
|
||||
this.process.send(message, err => {
|
||||
if (err) reject(err); else resolve(this);
|
||||
});
|
||||
if (!sent) throw new Error('Failed to send message to shard\'s process.');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue