abalabahaha / eris

A NodeJS Discord library
https://abal.moe/Eris/
MIT License
1.49k stars 418 forks source link

Errors handling news channels (type 5) #471

Closed TobySack closed 5 years ago

TobySack commented 5 years ago

I am an admin of the Rocket League discord and we were alerted that select few servers are going to have access to a new feature where they can publish news stories that will appear on the "Activity" tab. image

Whenever a reaction happens in the announcements channel, it causes the shard to crash with:

TypeError: Cannot read property 'get' of undefined
     at Shard.wsEvent (/root/discord-bot/node_modules/eris/lib/gateway/Shard.js:583:71)
     at Shard.onWSMessage (/root/discord-bot/node_modules/eris/lib/gateway/Shard.js:1737:26)
     at WebSocket.ws.onmessage (/root/discord-bot/node_modules/eris/lib/gateway/Shard.js:1615:33)
     at WebSocket.onMessage (/root/discord-bot/node_modules/ws/lib/event-target.js:120:16)
     at emitOne (events.js:115:13)
     at WebSocket.emit (events.js:210:7)
     at Receiver.receiverOnMessage (/root/discord-bot/node_modules/ws/lib/websocket.js:792:20)
     at emitOne (events.js:115:13)
     at Receiver.emit (events.js:210:7)
     at Receiver.dataMessage (/root/discord-bot/node_modules/ws/lib/receiver.js:422:14)

I was able to reproduce this error anytime I add or remove a reaction in the channel. Right now the lines in Shard.js where the error happens is 513, 548, 583

I forgot to mention I am on the dev branch

eritbh commented 5 years ago

Is there any documentation about that feature anywhere?

Internally, the error seems to be caused by a channel being created with no messages collection, which I have a hunch could result from the channel having an unrecognized type.

TobySack commented 5 years ago

I am guessing there is no documentation since they released this to very few servers to try out the feature. I'm sure as it rolled out they may document it more.

abalabahaha commented 5 years ago

Can you drop by the Discord channel in the README?