mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
Clean up a bunch of promise stuff
This commit is contained in:
@@ -134,17 +134,19 @@ class Shard {
|
||||
if (message) {
|
||||
// Shard is requesting a property fetch
|
||||
if (message._sFetchProp) {
|
||||
this.manager.fetchClientValues(message._sFetchProp)
|
||||
.then(results => this.send({ _sFetchProp: message._sFetchProp, _result: results }))
|
||||
.catch(err => this.send({ _sFetchProp: message._sFetchProp, _error: makePlainError(err) }));
|
||||
this.manager.fetchClientValues(message._sFetchProp).then(
|
||||
results => this.send({ _sFetchProp: message._sFetchProp, _result: results }),
|
||||
err => this.send({ _sFetchProp: message._sFetchProp, _error: makePlainError(err) })
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Shard is requesting an eval broadcast
|
||||
if (message._sEval) {
|
||||
this.manager.broadcastEval(message._sEval)
|
||||
.then(results => this.send({ _sEval: message._sEval, _result: results }))
|
||||
.catch(err => this.send({ _sEval: message._sEval, _error: makePlainError(err) }));
|
||||
this.manager.broadcastEval(message._sEval).then(
|
||||
results => this.send({ _sEval: message._sEval, _result: results }),
|
||||
err => this.send({ _sEval: message._sEval, _error: makePlainError(err) })
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user