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

discord.jsのバージョンを上げる #50

Open
YuMuuu opened this issue Jul 31, 2022 · 0 comments
Open

discord.jsのバージョンを上げる #50

YuMuuu opened this issue Jul 31, 2022 · 0 comments

Comments

@YuMuuu
Copy link
Collaborator

YuMuuu commented Jul 31, 2022

サバイバーエージェントで利用している際に以下のエラーが発生

/home/hogehoge/gohan-dekitayo/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 (/home/hogehoge/gohan-dekitayo/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at Object.module.exports [as MESSAGE_CREATE] (/home/hogehoge/gohan-dekitayo/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/hogehoge/gohan-dekitayo/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/hogehoge/gohan-dekitayo/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/hogehoge/gohan-dekitayo/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/hogehoge/gohan-dekitayo/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:375:28)
    at Receiver.receiverOnMessage (/home/hogehoge/gohan-dekitayo/node_modules/ws/lib/websocket.js:833:20)
    at Receiver.emit (events.js:375:28)
    at Receiver.dataMessage (/home/hogehoge/gohan-dekitayo/node_modules/ws/lib/receiver.js:517:14)

https://stackoverflow.com/questions/72077172/typeerror-cannot-read-properties-of-undefined-reading-cache-discord-js

I'm receiving the same type of error on my bot now, while it was previously working fine for a long time. You should take a look at the version of DiscordJS you're using. If it's < 13.3.1, consider upgrading - 13.3.1 contains the fix for this issue.

v13に更新すれば直るかも?

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

Successfully merging a pull request may close this issue.

1 participant