#Discord voice notes reach the listener, never OpenClaw message handler / transcription pipeline

8 messages · Page 1 of 1 (latest)

solar moth
#

I’m trying to enable automatic transcription of Discord voice notes in OpenClaw using local Whisper.
What is already confirmed:

local Whisper works correctly on the real .ogg files saved by OpenClaw
the voice files are successfully downloaded to disk
the base Discord listener does receive the voice note as a real event
the voice note arrives with this shape:
type=0
flags=8192
attachment audio/ogg
filename=voice-message.ogg
waveform present
durationSecs present

The problem:

that event does not continue into the normal handler
it does not reach preflightDiscordMessage
it does not reach processDiscordMessage
so it never enters the native media/audio pipeline and never posts back the transcript

We already added patches/logging across several layers of the compiled runtime, and the drop seems to happen between DiscordMessageListener.handle(...) and the real handler / debounce / preflight stage.

Specific questions for help:

Are Discord voice notes (flags=8192) routed through a different path in OpenClaw / Carbon?
Is there a filter or special listener type that prevents those messages from reaching the normal MESSAGE_CREATE flow?
What is the correct place to hook them and force them into the same pipeline as a normal attachment message?

arctic sealBOT
brisk lilyBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

arctic sealBOT
ashen turretBOT
#

Small extra check: there is no Discord-side special casing for flags=8192 anywhere in the monitor code I could find. I’m confirming the debounce piece and then I’ll answer cleanly.

#

I checked the source for 2026.4.9, and I do not see a separate inbound path for Discord voice notes.

What I found:

  • registerDiscordMonitorListeners(...) registers a normal DiscordMessageListener.
  • DiscordMessageListener extends Carbon’s MessageCreateListener.
  • Carbon 0.15.0 MessageCreateListener.parseRawData(...) just wraps the raw MESSAGE_CREATE payload into Message/User, no special flags=8192 branch.
  • In OpenClaw, there is no repo hit for a Discord-side 8192 / IS_VOICE_MESSAGE filter in the monitor path.
  • VoicePlugin is voice-channel stuff, not message voice notes.

So the intended path is still the normal one:

DiscordMessageListener.handle -> createDiscordMessageHandler -> debouncer.enqueue -> preflightDiscordMessage -> processDiscordMessage

Also, media messages should not get stuck in text debounce:

  • shouldDebounceTextInbound(...) returns false when hasMedia is true.
#

And preflight already expects audio attachments:

  • preflight-audio.ts filters attachment.content_type?.startsWith("audio/")
  • there is even a preflight test covering audio/ogg

So if your logs really show DiscordMessageListener.handle(...) firing but nothing inside the handler path, the most suspicious line is the handoff trampoline in listeners.ts:

void Promise.resolve()
  .then(() => this.handler(data, client))
  .catch(...)

That is basically the only bridge between handle(...) and the real handler.

My recommendation:

  1. First debug test
#

Temporarily change that to:

async handle(data, client) {
  this.onEvent?.();
  await this.handler(data, client);
}

If voice notes start flowing, the bug is the async handoff, not preflight/media.

  1. Best workaround hook
    If you want to force voice notes into the normal pipeline, hook in createDiscordMessageHandler(...), not VoicePlugin.

    A targeted workaround is:

    • detect ((message.flags ?? 0) & 8192) !== 0
    • confirm at least one audio/* attachment