How much time you lost in a discord voice channel ?
README.md

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).

The simplest and most secure way to host this bot in production is using Docker.

1. Prerequisites #

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:

  1. Ensure Rust is installed.
  2. Copy the example file to create your configuration:
cp .env.exemple .env
  1. Edit the .env file with your information:
TOKEN=your_discord_token_here
GUILD_ID=your_discord_server_id
  1. 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.