Back

Discord Voice Timer Bot | DanoGlez

September 5, 2025

3 min read

Discord Voice Timer Bot

Sometimes the best ideas come out of nowhere. This project is one of those — a personal side project I put together in just a couple of days for the Discord community.
The idea was simple: “What if we could measure how much time people really spend in voice channels?”

And so, the Discord Voice Timer Bot was born. 🚀
It’s lightweight, fast to set up, and it already provides real-time insights into voice activity. It’s not meant to be perfect (yet), but rather a cool utility that can grow over time with feedback from the community.

Why I built this

  • To scratch a personal itch: I wanted to know who’s always hanging out in voice.
  • To learn more about handling Discord voice events in discord.js.
  • To give something simple but useful back to the community.

Features

  • Automatic tracking: every minute, the bot checks who’s in voice and adds +1 to their counter.
  • Smart filters: bots and deafened/muted users don’t count.
  • Organized stats: everything is stored in clean monthly JSON files (e.g. guildid_2025_09.json).
  • Slash commands: /stats, /live, /reset, /config logchannel:#channel.
  • Multi-server support: each server gets its own config and stats.

Quick Setup

  1. Clone the repo:
    git clone https://github.com/DanoGlez/discord-voice-timer-bot.git
    cd discord-voice-timer-bot
  2. Install dependencies:
    npm install
  3. Copy and edit .env:
    cp .env.example .env
    Add your Discord token (DISCORD_TOKEN=your_token) and optionally a port (PORT=3000).
  4. Run the bot:
    npm start
    Or for development with auto-reload:
    npm run dev

Commands

  • /config logchannel:#channel – set a log channel for connections/disconnections.
  • /stats [period] – show voice stats for current month, last 24h, last week, or even a specific month.
  • /live – see real-time voice activity for this month.
  • /reset [period] – reset data for the current or chosen period.
  • !help – classic text-based help.

Requirements

  • Node.js ≥ v18
  • A Discord bot token (create one in the Developer Portal)
  • Permissions:
    • View channels
    • Send messages
    • Use application commands
    • Connect and view voice state

Project Structure

discord-voice-timer-bot/
├── commands/           – command handlers
├── config/             – bot configs
├── system/
│   ├── dataManager.js  – JSON data management
│   └── voiceHandler.js – voice event handler
├── data/               – JSON files by server/month
│   ├── guild_configs.json
│   └── {guildId_YYYY_MM}.json
├── .env.example
├── index.js
├── package.json
├── README.md
├── CHANGELOG.md
├── CONTRIBUTING.md
└── LICENSE

Logs & Troubleshooting

  • Slash commands not showing up? → make sure the bot has “Use application commands” permission (can take up to 1h).
  • Data not saving? → check folder permissions for data/ (e.g. chmod 755 ./data/).
  • Deprecation warnings? → update discord.js to v14.14.1+.

Example log:

[14:30:45] Checking voice channels...
[My Server] Channel "General": 3 user(s)
 Detected: User1
 Detected: User2
 Deafened (ignored): User3
[14:31:45] +1 minute added to 2 user(s) who remained connected

✨ This project is just the start. It’s small, scrappy, and made with love — but the vision is to make it a go-to tool for Discord communities that want to keep track of voice activity.
If you like it, feel free to star the repo, test it, and suggest new features!