Discord Bot logged in as SOUSA#9586
(node:14380) UnhandledPromiseRejectionWarning: ReferenceError: GetNumPlayerIndices is not defined
at setStatus (C:\Users\vasco\Desktop\discord Bot\utils\index.js:18:9)
at updatePlayerCount (C:\Users\vasco\Desktop\discord Bot\utils\index.js:22:9)
at Client.<anonymous> (C:\Users\vasco\Desktop\discord Bot\bot.js:8:3)
at Client.emit (events.js:323:22)
at WebSocketManager.triggerReady (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:253:17)
at WebSocketManager.checkReady (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:224:61)
at Object.module.exports [as GUILD_CREATE] (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\websocket\handlers\GUILD_CREATE.js:11:17)
at WebSocketManager.handlePacket (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:201:31)
at WebSocketShard.onPacket (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:259:29)
at WebSocketShard.onMessage (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:310:10)
(node:14380) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14380) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:14380) UnhandledPromiseRejectionWarning: Error [WS_CONNECTION_TIMEOUT]: The connection to the gateway timed out.
at Timeout._onTimeout (C:\Users\vasco\Desktop\discord Bot\node_modules\discord.js\src\client\Client.js:261:16)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
(node:14380) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
I get this error when starting the bot, I have the same code as you.
{
"name": "fivem_discord_bot",
"version": "1.0.0",
"description": "",
"main": "bot.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "github:vecchiotom/discord.js"
}
}