#Bot keeps crashing

26 messages · Page 1 of 1 (latest)

tidal runeBOT
#

@honest apex, you just advanced to level 3 !

fervent forgeBOT
#

@honest apex posted:
My bot has started to crash a little bit after starting up, this is the error:
27.11 19:25:31 [Bot] /node_modules/discord.js/src/client/actions/MessageCreate.js:11
27.11 19:25:31 [Bot] const existing = channel.messages.cache.get(data.id);
27.11 19:25:31 [Bot] ^
27.11 19:25:31 [Bot] TypeError: Cannot read property 'cache' of undefined
27.11 19:25:31 [Bot] at MessageCreateAction.handle (/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
27.11 19:25:31 [Bot] at Object.module.exports [as MESSAGE_CREATE] (/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
27.11 19:25:31 [Bot] at WebSocketManager.handlePacket (/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
27.11 19:25:31 [Bot] at WebSocketShard.onPacket (/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
27.11 19:25:31 [Bot] at WebSocketShard.onMessage (/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
27.11 19:25:31 [Bot] at WebSocket.onMessage (/node_modules/ws/lib/event-target.js:132:16)
27.11 19:25:31 [Bot] at WebSocket.emit (events.js:310:20)
27.11 19:25:31 [Bot] at Receiver.receiverOnMessage (/node_modules/ws/lib/websocket.js:835:20)
27.11 19:25:31 [Bot] at Receiver.emit (events.js:310:20)
27.11 19:25:31 [Bot] at Receiver.dataMessage (/node_modules/ws/lib/receiver.js:437:14)
27.11 19:25:31 [PebbleHost] Server shut down (running)
27.11 19:25:31 [PebbleHost] Server stopped

Any help is appreciated! Ive been using this bot for a good year or so without issue

olive inlet
ornate kelp
#

The cache function is outdated and you shouldn’t use that

#

If you are on v14 of discord.js most likely your bot is coded for v13

honest apex
honest apex
ornate kelp
honest apex
ornate kelp
#

the package version what pebblehost is using

#

I think thats the issue

honest apex
#

should I update it to 13?

ornate kelp
#

yes try that

honest apex
#

running "npm install discord.js" will update to v14 right? is there a way to only do 13?

ornate kelp
#

you cant run commands

#

on the pebble terminal

honest apex
#

ah i need to update it in vsc sure

#

ill open it all now

ornate kelp
#

Most likely the server has 14.* installed

honest apex
#

this is what i see

#

remove and reinstall?

ornate kelp
#

Hmm it got the correct one installed

#

Wondering why it errors in the server but not on vscode then