discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.36k stars 3.97k forks source link

Bot crash while it updates itself #6510

Closed Positive2022 closed 3 years ago

Positive2022 commented 3 years ago

Please describe the problem you are having in as much detail as possible: I was updating my bot's pfp and I had my bots console opened cuz I was updating it. Just when i updated the bot's pfp, the bot crashed giving out an error.

Error:

/home/container/node_modules/discord.js/src/client/actions/UserUpdate.js:11
    const oldUser = newUser._update(data);
                            ^

TypeError: Cannot read property '_update' of undefined
    at UserUpdateAction.handle (/home/container/node_modules/discord.js/src/client/actions/UserUpdate.js:11:29)
    at Object.module.exports [as USER_UPDATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/USER_UPDATE.js:4:29)
    at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:345:31)
    at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:443:22)
    at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:300:10)
    at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:394:28)
    at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:970:20)
    at Receiver.emit (node:events:394:28)
    at Receiver.dataMessage (/home/container/node_modules/ws/lib/receiver.js:517:14)

Further details:

Relevant client options:

Positive2022 commented 3 years ago

Note: Also happened when I changed the bots username. Note 2: The pfp error that occured when I changed application's pfp which ofcourse changes bot user's pfp. Edit: Same error when I remove/add a intent to bot from discord developer portal.