A HLL CRCON Discord bot that monitors player counts for a game server using an CRCON API and displays them in a Discord channel.
- Node.js v18 or higher
- A Discord bot token (create a bot at Discord Developer Portal)
- Access to an RCON API for your game server
- A Discord channel ID where the bot will post updates
-
Clone the repository:
git clone https://github.com/hackletloose/hall-crcon-player-count.git cd hall-crcon-player-count
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your environment variables (use.env.example
as a template):DISCORD_TOKEN=your_discord_bot_token CRCON_API_KEY=your_rcon_api_key CRCON_API_URL=your_rcon_api_url CHANNEL_ID=your_discord_channel_id
-
Start the bot:
node main.mjs
- Fetches player counts (Steam, Xbox/Epic, VIP) from an RCON API.
- Displays player counts in a Discord embed, updated every 60 seconds.
- Clears old messages in the specified channel on startup.
- Handles errors gracefully with logging.
Variable | Description |
---|---|
DISCORD_TOKEN | Discord bot token |
CRCON_API_KEY | RCON API key for the server |
CRCON_API_URL | RCON API URL for the server |
CHANNEL_ID | Discord channel ID for posting updates |
MIT