A Discord bot that displays server statistics including PM2 process status, Docker container status, and PostgreSQL server status. The bot updates its statistics periodically and can also respond to user commands. *
- Displays PM2 process status for the Lavalink process.
- Monitors the status of Docker containers:
- You can change the container names to your desired containers:
- grave-grave
- grave-echo-grave
- redis:7.2.5
- Checks the status of the PostgreSQL server.
- Generates and updates a visual representation of the server stats on a Discord channel.
- Responds to the
!stats
command with the latest server stats image.
Make sure you have the following installed:
-
Clone the Repository:
git clone https://github.com/exril/stats-bot.git cd stats-bot
-
Install Dependencies:
Run the following command to install the required Node.js packages:
npm install
-
Create
config.json
:Create a
config.json
file in the src folder of the project and add your Discord bot token and the channel ID where you want the bot to send the stats. The file should look like this:{ "token": "YOUR_BOT_TOKEN", "channelId": "YOUR_CHANNEL_ID" }
Replace
YOUR_BOT_TOKEN
andYOUR_CHANNEL_ID
with your actual bot token and the channel ID. -
Background Image:
Place a background image named
background.png
in the root directory. This image will be used as the canvas background for the stats display. -
Run the Bot:
Start the bot using Node.js:
node index.js
Alternatively, if you're using PM2, you can run it as follows:
pm2 start index.js --name "ServerStatsBot"
-
Check the Bot's Status:
The bot will post updates in the specified Discord channel every 9 seconds. You can also manually request the latest stats by sending the
!stats
command in the channel.
- !stats: Command to retrieve the latest server stats manually.
You can modify the appearance of the stats by editing the drawing functions in the code. Feel free to change the font sizes, colors, and layout to better fit your needs.
Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Contact : [email protected]