fix(voice): self-undeafen/self-unmute bot instantly on server mute/deafen
Previously forceSelfServerUnmuteUndeafen only ran on video-watch attempts and after voice reconnects — so when an admin server-muted or server-deafened the bot, it stayed muted/deafened for minutes (or forever if no streamer came on). Add registerSelfVoiceStateGuard: a voiceStateUpdate listener that detects the bot's own serverMute/serverDeaf transition to true and immediately re-issues mute:false,deaf:false. Wired at client-ready in bootstrap.ts. Best-effort, idempotent, never blocks the gateway.
This commit is contained in:
@@ -36,6 +36,7 @@ import { registerPresenceCapture } from "../modules/user-presence/index.js";
|
||||
import { VoicePcmWsClient } from "../modules/voice-pcm-ws/index.js";
|
||||
import { startMuxerWorker } from "../modules/voice-recording/muxer.js";
|
||||
import {
|
||||
registerSelfVoiceStateGuard,
|
||||
setPcmWsClient,
|
||||
setEventBroadcaster as setRecorderEventBroadcaster,
|
||||
} from "../modules/voice-recording/recorder.js";
|
||||
@@ -298,6 +299,12 @@ export async function initializeDiscordGateway() {
|
||||
),
|
||||
);
|
||||
|
||||
// Attach the immediate self-undeafen/self-unmute guard so the bot reacts
|
||||
// INSTANTLY when an admin server-mutes or server-deafens it (previously
|
||||
// only re-asserted on video-watch/reconnect, leaving the bot muted for
|
||||
// minutes).
|
||||
registerSelfVoiceStateGuard(client);
|
||||
|
||||
// Start retention cleanup scheduler
|
||||
startRetentionCleanup();
|
||||
// Start weekly moderation digest (public, automated)
|
||||
|
||||
Reference in New Issue
Block a user