https://github.com/urpagin/vcobserver
Small Discord.py plugin to monitor how much time members spend in voice channels (with leaderboard).
https://github.com/urpagin/vcobserver
activity-tracking bot data-logging discord discordpy event-driven french-commands intents-enabled json-storage leaderboard localization plug-in presence-tracking python session-monitoring time-tracking user-metrics vc voice-channels voice-time
Last synced: about 2 months ago
JSON representation
Small Discord.py plugin to monitor how much time members spend in voice channels (with leaderboard).
- Host: GitHub
- URL: https://github.com/urpagin/vcobserver
- Owner: Urpagin
- License: gpl-3.0
- Created: 2025-05-18T16:03:25.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-18T17:28:58.000Z (about 1 year ago)
- Last Synced: 2025-10-24T19:45:01.014Z (8 months ago)
- Topics: activity-tracking, bot, data-logging, discord, discordpy, event-driven, french-commands, intents-enabled, json-storage, leaderboard, localization, plug-in, presence-tracking, python, session-monitoring, time-tracking, user-metrics, vc, voice-channels, voice-time
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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**.

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