Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in OnMessageCreate, CommandClient.js #362

Closed
LynnAU opened this issue Feb 22, 2018 · 1 comment
Closed

TypeError in OnMessageCreate, CommandClient.js #362

LynnAU opened this issue Feb 22, 2018 · 1 comment
Labels

Comments

@LynnAU
Copy link

LynnAU commented Feb 22, 2018

TypeError: Cannot read property 'id' of undefined
This seems to be occurring randomly or at least, I can't tell what behaviour causes this crash...

Points to line 142:58 of CommandClient.js, msg.author.id.

if((!this.commandOptions.ignoreSelf || msg.author.id !== this.user.id) && (!this.commandOptions.ignoreBots || !msg.author.bot) && (msg.prefix = this.checkPrefix(msg)))

Full stacktrace:

events.js:182
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'id' of undefined
    at CommandClient.onMessageCreate (C:\Users\thoma\dev\isac-modularity\node_modules\eris\lib\command\CommandClient.js:142:58)
    at emitOne (events.js:120:20)
    at CommandClient.emit (events.js:210:7)
    at Shard.emit (C:\Users\thoma\dev\isac-modularity\node_modules\eris\lib\gateway\Shard.js:1877:26)
    at Shard.wsEvent (C:\Users\thoma\dev\isac-modularity\node_modules\eris\lib\gateway\Shard.js:418:26)
    at Shard.onWSMessage (C:\Users\thoma\dev\isac-modularity\node_modules\eris\lib\gateway\Shard.js:1716:26)
    at WebSocket.ws.onmessage (C:\Users\thoma\dev\isac-modularity\node_modules\eris\lib\gateway\Shard.js:1593:33)
    at WebSocket.onMessage (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\EventTarget.js:99:16)
    at emitOne (events.js:115:13)
    at WebSocket.emit (events.js:210:7)
    at Receiver._receiver.onmessage (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\WebSocket.js:141:47)
    at Receiver.dataMessage (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\Receiver.js:389:14)
    at Receiver.getData (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\Receiver.js:330:12)
    at Receiver.startLoop (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\Receiver.js:165:16)
    at Receiver.add (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\Receiver.js:139:10)
    at TLSSocket._ultron.on (C:\Users\thoma\dev\isac-modularity\node_modules\eris\node_modules\ws\lib\WebSocket.js:138:22)
@InATrance
Copy link

I get this error a lot too.

msg.author is undefined.
Perhaps add a checker for if msg.author is defined?

nandub added a commit to nandub/eris that referenced this issue Mar 14, 2018
* upstream/master:
  0.8.5
  Add option to manually offset ratelimiter
  Add Eris.VERSION (abalabahaha#364)
  Avoid negative average latency (fix abalabahaha#365)
  Code/docs tidying
  Check for missing msg.author in CommandClient (fix abalabahaha#362)
  Fix voice receive stream cleanup (fix abalabahaha#359)
  Fix Spotify presence update caching (abalabahaha#363)
  Update editStatus docs (abalabahaha#361)
  Expose userID for CommandClient reaction buttons
  Expose activity and application properties in Message
  Fix user caching for ban events
nandub added a commit to nandub/eris that referenced this issue Mar 14, 2018
* upstream/master:
  0.8.5
  Add option to manually offset ratelimiter
  Add Eris.VERSION (abalabahaha#364)
  Avoid negative average latency (fix abalabahaha#365)
  Code/docs tidying
  Check for missing msg.author in CommandClient (fix abalabahaha#362)
  Fix voice receive stream cleanup (fix abalabahaha#359)
  Fix Spotify presence update caching (abalabahaha#363)
  Update editStatus docs (abalabahaha#361)
  Expose userID for CommandClient reaction buttons
  Expose activity and application properties in Message
  Fix user caching for ban events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants