Add voice log to track join and leave events - #210
Conversation
Adds a /voice log view with join/leave events, paging controls, and issuer-only deletion. Extends the command layer with channel options and updates guild lookup to use paged embeds.
…d additional cleanup
|
| }; | ||
|
|
||
| export default class VoiceLog extends BotComponent { | ||
| private readonly event_history = new SelfClearingMap<string, voice_log_event[]>(JOIN_HISTORY_TTL); |
There was a problem hiding this comment.
This isn't going to be sufficient. In practice the bot runs for weeks at a time but this should not be relied on.
There was a problem hiding this comment.
Originally I intended for this being stored in memory as a feature to avoid needing to change the db, but I can change that to use the db going forward.
|
|
||
| if (this.wheatley.devmode_enabled) { | ||
| commands.add( | ||
| new TextBasedCommandBuilder("dev-voice-bounce", EarlyReplyMode.ephemeral) |
There was a problem hiding this comment.
If this is kept it would best be put somewhere like utility-tools to keep component focused - the logic for this command doubles the size of this component.
| ), | ||
| ); | ||
|
|
||
| this.guild_lookup_page_button = commands.add( |
There was a problem hiding this comment.
Please move changes to this file to a separate PR to keep this PR focused
| // Sort primarily by position when available otherwise push to the end. | ||
| const channels = [...guild.channels.cache.values()].sort((a, b) => { | ||
| const pos_a = | ||
| "rawPosition" in a && typeof (a as any).rawPosition === "number" |
There was a problem hiding this comment.
Why do you need to any cast here?
| } | ||
| } | ||
|
|
||
| const requested_n = n ?? 1; |
There was a problem hiding this comment.
Isn't this going to show only 1 item unless n is passed?
| } | ||
| } else { | ||
| assert(false, "unhandled option type"); | ||
| switch (option.type) { |
There was a problem hiding this comment.
Nesting a switch in this if-else-if-else chain handling all the option types in order to handle two cases isn't the right shape for this, please fix
|



Summary
This PR introduces a new
voice logcommand that provides a recent history of voice join and leave activity for a channel. The intent is to give moderators a practical way to identify who entered or exited a voice channel when an incident happens too quickly to observe live.It also includes dev-only tooling to generate voice join/leave events for testing. That tooling is isolated and can be removed after review if desired.
New
voice logcommand for viewing recent voice join/leave activity in a voice channel./dev-voice-bouncecommand for generating voice join/leave events during testing.Changes