Repository navigation
Track Stage listenership and report stats when a Stage ends - #529
Merged
Merged
Conversation
On stageInstanceCreate, track joins/leaves in the Stage channel. On stageInstanceDelete, post an overview (concurrency area chart, join/leave sparklines, listen-time histogram) and a top-20 listener timeline to vcLog. Also fix voiceStateUpdate resetting join time on mute/deafen, and log time spent in the old channel when a member moves channels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a Stage goes live (
stageInstanceCreate, covered by the existingGuildsintent), track everyone in the Stage channel. When it ends (stageInstanceDelete), post two messages tovcLog:Both messages stay under Discord's 2,000-character limit at 400 listeners with a peak of 283 concurrent; there is a test for this.
Sample output
From the 400-listener test (topic "Big one"; the test uses placeholder names):
A smaller run with real rejoins (alice leaves at 20m and comes back at 30m):
Also fixed
voiceStateUpdatefires on mute, deafen and stream changes, which reset each member's join time. It now only acts on channel moves, and a move logs the time spent in the old channel.Limits
Testing
npm testpasses, with new unit tests insrc/features/stage-stats.test.ts. Not yet tried against a live Stage.🤖 Generated with Claude Code