mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01: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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user