Vocal Time Counter #
Note: this repository lives on Tangled, GitHub is only a mirror. If you came here from GitHub to open a pull request, it would be even better to open it on Tangled if you can.
๐ Overview #
Vocal Time Counter is a Discord bot written in Rust designed to accurately track the time members spend in voice channels.
It doesn't just count global time: it also tracks time spent while muted, deafened, streaming, or with a camera turned on.
โจ Features #
- โฑ๏ธ Total time tracking in voice channels.
- ๐ Specific state tracking: Mute, Deafen, Streaming, and Video.
- ๐ Automatic leaderboards for the most active members.
- ๐ Global server statistics including top voice channels ranking.
๐ ๏ธ Available Commands #
/time [user]: Displays complete voice statistics for yourself or another member./leaderboard [limit]: Displays the ranking of the most active members (default top 10)./server [limit]: Displays global server stats (total time, stream time, etc.) and the ranking of the most popular voice channels./ping: Displays the bot's response time (latency).
โ๏ธ Configuration & Deployment (Recommended) #
The simplest and most secure way to host this bot in production is using Docker.
1. Prerequisites #
- Docker and Docker Compose installed on your server (e.g., Ubuntu).
- A Discord bot token (obtained from the Discord Developer Portal).
2. Clone the Repository #
git clone https://github.com/pixilie/vocal-time-counter/ # (or git@github.com:pixilie/vocal-time-counter.git)
cd vocal-time-counter
3. Environment Configuration #
Edit the docker-compose.yml file with your information:
environment:
- TOKEN=your_discord_token_here
- GUILD_ID=your_discord_server_id
- RUST_LOG=info
Note: As of now, the bot registers its commands specifically to the server provided in GUILD_ID so they update instantly without delay.
4. Launch with Docker #
The docker-compose.yml file is pre-configured to build the bot and create a persistent volume for your statistics (./data/data.json).
Run this command to build and start the bot in the background:
docker compose up -d --build
Important: Your data will survive restarts! It is saved persistently in the data/ folder automatically created at the root of your project.
5. Updating the Bot #
If there is an update, you can deploy the new version without losing your statistics by simply running:
docker compose up -d --build
๐จโ๐ป Local Development (Without Docker) #
To develop or test locally:
- Ensure Rust is installed.
- Copy the example file to create your configuration:
cp .env.exemple .env
- Edit the
.envfile with your information:
TOKEN=your_discord_token_here
GUILD_ID=your_discord_server_id
- Run the project with Cargo:
cargo run
Note: As of now, the bot registers its commands specifically to the server provided in GUILD_ID so they update instantly without delay.
Support & Contact #
If you encounter bugs or have suggestions, feel free to contact me:
- Discord:
@pixilie - Email:
contact@pixilie.net
๐ License #
This project is licensed under the MIT License. See the LICENSE file for details.