Skip to content

Add /vc command suite with low-overhead voice activity tracking, blacklist controls, and hourly top-10 reporting - #24

Draft
deepdeyiitgn with Copilot wants to merge 1 commit into
mainfrom
copilot/add-voice-channel-activity-tracking
Draft

Add /vc command suite with low-overhead voice activity tracking, blacklist controls, and hourly top-10 reporting#24
deepdeyiitgn with Copilot wants to merge 1 commit into
mainfrom
copilot/add-voice-channel-activity-tracking

Conversation

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This change introduces a voice-activity feature set that mirrors the existing /setup command UX/style and storage conventions, while adding voice-specific tracking, blacklist management, and periodic leaderboard output. It uses join/leave/session transitions (not polling) to keep runtime overhead low and aligns logs with the configured setup logs channel.

  • /vc command group aligned to /setup behavior

    • Added a new /vc command suite with setup-style subcommand structure, messaging theme, and permission/guard patterns.
    • Kept interaction and embed formatting consistent with existing setup/log presentation, adapted for voice activity semantics.
  • Event-driven VC tracking model (low server pressure)

    • Implemented tracking via on_voice_state_update using session start/end timestamps.
    • Handles:
      • join → start session
      • leave → close session, compute elapsed, accumulate total
      • channel switch → close previous session + start new one
    • Ignores bot users and includes defensive handling for missing/partial session state after restarts.
  • Storage and compatibility

    • Added voice-activity persistence using the repository’s existing DB/storage conventions used by setup/text tracking.
    • Persists cumulative per-user VC time and required session/log data without changing current text-tracking behavior.
  • VC blacklist management

    • Added /vc blacklist controls to add/remove/list/check excluded voice channels.
    • Added channel selection UX using voice-channel suggestion patterns (autocomplete/picker behavior consistent with existing command patterns).
    • Blacklisted voice channels are excluded from tracked time.
  • Logging + hourly leaderboard

    • Integrated with the configured logs channel from setup configuration.
    • Added join/leave logs for counted VC channels including:
      • per-session duration on leave
      • updated cumulative total after aggregation
    • Added lightweight hourly top-10 VC activity message based on cumulative tracked time, following existing theme style.
# Voice state transition pattern used for low-overhead tracking
if before.channel != after.channel:
    if before.channel and is_counted(before.channel):
        elapsed = end_session(member.id)
        total = add_to_cumulative(member.id, elapsed)
        await log_leave(member, before.channel, elapsed, total)

    if after.channel and is_counted(after.channel):
        start_session(member.id)
        await log_join(member, after.channel)

Copilot AI changed the title [WIP] Add voice-channel activity tracking feature with /vc commands Add /vc command suite with low-overhead voice activity tracking, blacklist controls, and hourly top-10 reporting Aug 4, 2026
Copilot AI requested a review from deepdeyiitgn August 4, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants