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

Sending any message in a voice channel text channel crashes this application #623

Open
014972304505347 opened this issue Jan 13, 2023 · 3 comments

Comments

@014972304505347
Copy link

Voice channels have accompanying text channels. It seems these do not have message caches, so sending a message in here crashes the discord.js module and thus the entire application. Would this be patchable here or does it need to be fixed in the discord.js module itself?

/usr/local/lib/node_modules/discord-irc/node_modules/discord.js/src/client/actions/MessageCreate.js:11
      const existing = channel.messages.cache.get(data.id);
                                        ^

TypeError: Cannot read property 'cache' of undefined
    at MessageCreateAction.handle (/usr/local/lib/node_modules/discord-irc/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at Object.module.exports [as MESSAGE_CREATE] (/usr/local/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/usr/local/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/usr/local/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/usr/local/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/usr/local/lib/node_modules/discord-irc/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:198:13)
    at Receiver.receiverOnMessage (/usr/local/lib/node_modules/discord-irc/node_modules/ws/lib/websocket.js:1068:20)
    at Receiver.emit (events.js:198:13)
    at Receiver.dataMessage (/usr/local/lib/node_modules/discord-irc/node_modules/ws/lib/receiver.js:517:14)
@KeiroD
Copy link

KeiroD commented Feb 20, 2023

Yep:

2023-02-20T05:28:58.866Z warn: Received warn event from Discord Discord sent a typing packet to a voice channel 848707213451067392
/usr/lib/node_modules/discord-irc/node_modules/discord.js/src/client/actions/MessageCreate.js:11
      const existing = channel.messages.cache.get(data.id);
                                        ^

TypeError: Cannot read properties of undefined (reading 'cache')
    at MessageCreateAction.handle (/usr/lib/node_modules/discord-irc/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at module.exports [as MESSAGE_CREATE] (/usr/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/usr/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/usr/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/usr/lib/node_modules/discord-irc/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/usr/lib/node_modules/discord-irc/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:513:28)
    at Receiver.receiverOnMessage (/usr/lib/node_modules/discord-irc/node_modules/ws/lib/websocket.js:983:20)
    at Receiver.emit (node:events:513:28)
    at Receiver.dataMessage (/usr/lib/node_modules/discord-irc/node_modules/ws/lib/receiver.js:517:14)

Node.js v18.14.0

Looks like it's discord.js that's having the issue, so... probably update discord.js? I'll report back on this.

Edit: Reporting back -- still crashes after updating discord.js.

@KeiroD
Copy link

KeiroD commented Feb 20, 2023

I've posted an upstream issue in discord.js here so hopefully this'll get fixed relatively quickly since it seems to be a discord.js issue.

Edit: They said it was due to discord.js being a pinned version on discord-irc and so needs to be fixed here.

@aronson
Copy link

aronson commented Aug 24, 2023

I upgraded it to v14
#632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants