Small plugin to monitor how much time members spend in voice channels (with leaderboard).
Find a file
2025-05-18 19:28:56 +02:00
src todo 2025-05-18 19:28:56 +02:00
.gitignore add code 2025-05-18 18:21:27 +02:00
LICENSE Initial commit 2025-05-18 18:03:25 +02:00
README.md Update README.md 2025-05-18 18:37:59 +02:00

VcObserver (Discord Bot plugin)

A lightweight plugin to monitor how much time members spend in voice channels.

[!IMPORTANT] Command names and strings are in French.

image

Compatibility

Compatible with bots using discord.py.

Ensure the following intents are enabled:

  • voice_states
  • members

Installation

  1. Copy src/vc_observer.py into your project.
  2. Import the VcObserver class.
  3. Ensure logging is initialized in your bot.
  4. Instantiate the class with the following parameters: bot, tree, filepath, and optionally guild_ids.
  5. Call tree.sync() after initializing VcObserver(); otherwise, commands will not sync.

If you're having trouble, please take a look at the example file at src/app.py.

Behavior

When a user connects, disconnects, or switches between voice channels, the bot logs their time spent in the previous channel to a JSON file.

Tip

If the bot is stopped or crashes while users are in voice channels, their ongoing session time will not be recorded.