mirror of
https://github.com/Urpagin/VcObserver.git
synced 2025-08-21 13:58:01 +02:00
Small plugin to monitor how much time members spend in voice channels (with leaderboard).
src | ||
.gitignore | ||
LICENSE | ||
README.md |
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
- Copy
src/vc_observer.py
into your project. - Import the
VcObserver
class. - Ensure logging is initialized in your bot.
- Instantiate the class with the following parameters:
bot
,tree
,filepath
, and optionallyguild_ids
. - Call
tree.sync()
after initializingVcObserver()
; 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.