Skip to content

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

Description

@danielchen0

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions