FlorianSW / discord-player-count-bot

A discord bot that publishes the player count of a game server in the status of the bot user.
MIT License
18 stars 9 forks source link

"Invalid game" #10

Open rzm25 opened 1 month ago

rzm25 commented 1 month ago

Hi there, I'm getting an error when attempting to run this bot.

`PS D:\Coding Projects\V Bot\Florian\discord-player-count-bot> npm start

discord-player-count@1.0.0 prestart npm run build discord-player-count@1.0.0 build del-cli dist && tsc discord-player-count@1.0.0 start node ./dist/index.js

Starting Discord Bot... (node:25824) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) Logged in as V Rising 1#4200! ./config/maps.json does not exist App setup done... PollingProvider errored, retrying in 4 seconds for max 15 tries (1. try). Error: Invalid game: v rising PollingProvider errored, retrying in 6 seconds for max 15 tries (2. try). Error: Invalid game: v rising App is shutting down on user event`

My .env file looks like this:

`PLAYER_COUNT_PROVIDER=steam-query

Steam API provider specific

STEAM_API_TOKEN=C1... GAME_ADDRESS=localhost

Steam Query provider specific

GAME_TYPE="v rising" GAME_IP="127.0.0.1" GAME_QUERY_PORT="27016"`

Any help would be appreciated, thankyou!

rzm25 commented 1 month ago

I would like to add that v rising is in the list of supported games, and is listed as ID "vrising" which does not work either, if I edit the game ID in my .env to reflect this. The same error presents.

Logged in as V Rising 1#4200! ./config/maps.json does not exist App setup done... PollingProvider errored, retrying in 4 seconds for max 15 tries (1. try). Error: Invalid game: vrising PollingProvider errored, retrying in 6 seconds for max 15 tries (2. try). Error: Invalid game: vrising

rzm25 commented 1 month ago

Maybe it is an issue with my server?

Changing PLAYER_COUNT_PROVIDER to "steam" gives me an error also:

PS D:\Coding Projects\V Bot\Florian\discord-player-count-bot> npm start

discord-player-count@1.0.0 prestart npm run build

discord-player-count@1.0.0 build del-cli dist && tsc

discord-player-count@1.0.0 start node ./dist/index.js

Starting Discord Bot... (node:15716) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) Logged in as V Rising 1#4200! ./config/maps.json does not exist App setup done... PollingProvider errored, retrying in 4 seconds for max 15 tries (1. try). Error: Steam did not respond with a single server. Returned servers: undefined PollingProvider errored, retrying in 6 seconds for max 15 tries (2. try). Error: Steam did not respond with a single server. Returned servers: undefined PollingProvider errored, retrying in 8 seconds for max 15 tries (3. try). Error: Steam did not respond with a single server. Returned servers: undefined App is shutting down on user event

FlorianSW commented 1 month ago

STEAM_API_TOKEN=C1...

Before I go into the details of your issue: Please revoke and recreate the Steam API key by going to https://steamcommunity.com/dev/apikey and revoke the key there. You should never post this API Token to anyone, especially not in a public place. It is now well known and can be used by anyone.

FlorianSW commented 1 month ago

Regarding your last try with the Steam API (provider steam): this might simply not work with configuring "localhost" as the game IP address. The game server needs to be publicly available for steam to query it and to include it in the game list. You might want to use the public IP address of your server host for that.

FlorianSW commented 1 month ago

Regarding using steam-query: The version of gamedig (the library the bot uses for this provider) is relatively old and does not support V Rising 🙈 I can take a look into updating the library 👍

FlorianSW commented 1 month ago

With the latest push, vrising should work for the steam-query provider as well. However, you will need to use the public IP address of your server for that :)

rzm25 commented 1 month ago

Amazing, thankyou very much!

On Thu, May 30, 2024 at 12:38 AM Florian @.***> wrote:

With the latest push, vrising should work for the steam-query provider as well. However, you will need to use the public IP address of your server for that :)

— Reply to this email directly, view it on GitHub https://github.com/FlorianSW/discord-player-count-bot/issues/10#issuecomment-2137580638, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKUPJVXAM3MVQXPVQSCEY3ZEXR6VAVCNFSM6AAAAABIO52EAGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZXGU4DANRTHA . You are receiving this because you authored the thread.Message ID: @.***>