From 1b0836c7c7c7fa6aba16d4a5be84978bfd098122 Mon Sep 17 00:00:00 2001 From: isheng Date: Thu, 9 Jul 2026 17:43:49 +0800 Subject: [PATCH] fix(discord): wire voice input callback at adapter connect time _voice_input_callback was only set in _handle_voice_channel_join, not at adapter connect or reconnect. Voice transcription was logged but never forwarded as an inbound message without explicit /voice join. Wire the callback at both connect and reconnect paths. Fixes #60623 --- gateway/run.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gateway/run.py b/gateway/run.py index 5628554c3b5..2fbc4214556 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -8381,6 +8381,10 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew if success: self.adapters[platform] = adapter self._sync_voice_mode_state_to_adapter(adapter) + # Wire voice input callback at connect time so voice + # transcription is forwarded without requiring /voice join. + if hasattr(adapter, "_voice_input_callback"): + adapter._voice_input_callback = self._handle_voice_channel_input connected_count += 1 self._update_platform_runtime_status( platform.value, @@ -9451,6 +9455,9 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew if success: self.adapters[platform] = adapter self._sync_voice_mode_state_to_adapter(adapter) + # Wire voice input callback on reconnect as well (#60623). + if hasattr(adapter, "_voice_input_callback"): + adapter._voice_input_callback = self._handle_voice_channel_input self.delivery_router.adapters = self.adapters del self._failed_platforms[platform] self._update_platform_runtime_status(