Discord.js: Issue with client.shard.broadcastEval on master

Created on 1 Aug 2017  Â·  2Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
I am using client.shard.broadcastEval to start a function on another shard. Since yesterday / today, that throws me some errors (did not before).

Include a reproducible code sample here, if possible:
the variables are all fine and I logged them, seems to be sth with the client referring as "this" in broadcastEval. (chID is a DM channel ID, msgID is also from the DM, where the command was started)

if (!client.guilds.has(guild.id)) {
      await client.shard.broadcastEval(`
      if (this.guilds.has('${guild.id}'))  {
        bot.jumpOver = true;
        this.commands.get('events').run(this, this.channels.get('${result.chID}').messages.get('${result.msgID}'), ['${action}', ${number}, [${arguments}]])
      }
    `);
      return;
    }

Error is:

[00:13:17] - error: [Shard 0]  SyntaxError: Invalid or unexpected token
    at Komada._eval (C:\Coding\g4m3r\node_modules\komada\node_modules\discord.js\src\client\Client.js:523:17)
    at ShardClientUtil._handleMessage (C:\Coding\g4m3r\node_modules\komada\node_modules\discord.js\src\sharding\ShardClientUtil.js:108:76)
    at emitTwo (events.js:125:13)
    at process.emit (events.js:213:7)
    at handleMessage (internal/child_process.js:753:14)
    at Pipe.channel.onread (internal/child_process.js:472:11)

Further details:

  • discord.js version: latest master ([email protected])
  • node.js version: 8.1.3
  • Operating system: Windows 10
  • Priority this issue should have – please be realistic and elaborate if possible:

  • [ ] I found this issue while running code on a __user account__
  • [x] I have also tested the issue on latest master, commit hash: 79fed1295c32c7c04c140504bebcb2bd948c3733
question (please use Discord instead)

Most helpful comment

i hope you realize this is for issues with the library itself, not your code errors

All 2 comments

i hope you realize this is for issues with the library itself, not your code errors

yes. Absolutely. Since I didn’t change the code and only did a npm update, I was expecting this to be a lib error or atleast some lib changes.

If I am wrong please tell me, I am still learning :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lombra picture Lombra  Â·  3Comments

xCuzImPro picture xCuzImPro  Â·  3Comments

LLamaFTL picture LLamaFTL  Â·  3Comments

Dmitry221060 picture Dmitry221060  Â·  3Comments

PassTheMayo picture PassTheMayo  Â·  3Comments