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

ReferenceError: GetNumPlayerIndices is not defined #10

Closed
vsousa14 opened this issue Aug 4, 2020 · 0 comments
Closed

ReferenceError: GetNumPlayerIndices is not defined #10

vsousa14 opened this issue Aug 4, 2020 · 0 comments

Comments

@vsousa14
Copy link

vsousa14 commented Aug 4, 2020

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.

this is my package.json

{
  "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"
  }
}
@vsousa14 vsousa14 closed this as completed Aug 9, 2020
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

No branches or pull requests

1 participant