mirror of
https://github.com/danbulant/discord.js
synced 2026-06-06 00:02:52 +00:00
Fix ShardClientUtil#broadcastEval - now really accepting functions (#2248)
* small fix to broadcastEval accepting functions * dont ignore idea anymore (separate PR then)
This commit is contained in:
parent
351f5f7209
commit
42c0e50c92
1 changed files with 1 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ class ShardClientUtil {
|
||||||
*/
|
*/
|
||||||
broadcastEval(script) {
|
broadcastEval(script) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
script = typeof script !== 'function' ? `(${script})(this)` : script;
|
script = typeof script === 'function' ? `(${script})(this)` : script;
|
||||||
const listener = message => {
|
const listener = message => {
|
||||||
if (!message || message._sEval !== script) return;
|
if (!message || message._sEval !== script) return;
|
||||||
process.removeListener('message', listener);
|
process.removeListener('message', listener);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue