mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
allow passing a function to shard eval (#2193)
This commit is contained in:
@@ -86,6 +86,7 @@ class ShardClientUtil {
|
||||
*/
|
||||
broadcastEval(script) {
|
||||
return new Promise((resolve, reject) => {
|
||||
script = typeof script !== 'function' ? `(${script})(this)` : script;
|
||||
const listener = message => {
|
||||
if (!message || message._sEval !== script) return;
|
||||
process.removeListener('message', listener);
|
||||
|
||||
Reference in New Issue
Block a user