wtfnotavailable / Discord-MusicBot

Discord Music Bot Source Tree
Other
146 stars 67 forks source link

Discord resets Bot token because of to many requests #219

Open CallMeYuuuu opened 3 months ago

CallMeYuuuu commented 3 months ago

Hello, so I've been using this bot for a couple of months now and discord reset my bots token twice now because it "connected more than 1000 times within a short time period". I don't know why this happens.

This is the only error message I found in the logs and sadly don't know what it means. This error message spam started several hours before discord reset the token.

[25.03.2024 - 07:15] [ERROR] | [FATAL] Possibly Unhandled Rejection 
Reason: Error: WebSocket is not open: readyState 0 (CONNECTING)

Promise {
  <rejected> Error: WebSocket is not open: readyState 0 (CONNECTING)
      at WebSocket.send (/djs-bot/node_modules/ws/lib/websocket.js:449:13)
      at WebSocketShard.send (/djs-bot/node_modules/@discordjs/ws/dist/index.js:813:21)
      at async WebSocketShard.heartbeat (/djs-bot/node_modules/@discordjs/ws/dist/index.js:890:5)
}

If you need any more logs or information, please let me know. Thanks!

Bot Version: 5.5.1 Lavalink Version: v3

dwgdev commented 3 months ago

Check the bot connection code: Check the code responsible for setting up and maintaining the WebSocket connection in your bot. Ensure that errors and retries are handled properly.

Upgrade dependencies: Make sure you are using the latest versions of Discord.js and other relevant dependencies. Older versions may have bugs or compatibility issues that have been fixed in newer versions.

Logging and monitoring: Implement comprehensive logging in your bot to track WebSocket connection status and errors. This allows you to diagnose and troubleshoot problems more effectively. Additionally, consider monitoring tools or services that can alert you to connection issues in real time.