Skip to content

fix: treat QQ content_type "voice" as a voice message#72

Merged
quick-sort merged 1 commit into
mainfrom
fix/qq-voice-detection
Jun 28, 2026
Merged

fix: treat QQ content_type "voice" as a voice message#72
quick-sort merged 1 commit into
mainfrom
fix/qq-voice-detection

Conversation

@hilr

@hilr hilr commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • QQ Bot API tags voice attachments with the literal content_type: "voice" (not a standard audio/* MIME). The old _att_label only matched audio/*, so every voice message was mislabeled as "文件" and the asr_refer_text lookup added in feat: prefer QQ platform asr_refer_text for voice transcription #71 never ran.
  • Add _is_voice(att) accepting content_type == "voice", an audio/* prefix, a non-empty asr_refer_text, or voice file extensions (.amr/.silk/.slk/.slac). Both _att_label and _download_atts now use it.
  • Approach mirrors isVoiceAttachment in tencent-connect/openclaw-qqbot.

Test plan

  • ruff check + syntax check pass
  • A real QQ voice message is labeled "语音" and uses asr_refer_text (can't reproduce locally — needs a live QQ voice event through the gateway)

🤖 Generated with Claude Code

QQ Bot API tags voice attachments with the literal content_type "voice",
not a standard audio/* MIME. The old _att_label only matched "audio/*",
so voice messages fell through to "文件" and never reached the
asr_refer_text path introduced in #71. Add _is_voice() that accepts
"voice"/audio*, a non-empty asr_refer_text, or voice extensions
(.amr/.silk/.slk/.slac).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@quick-sort
quick-sort merged commit d3803ba into main Jun 28, 2026
1 check passed
@quick-sort
quick-sort deleted the fix/qq-voice-detection branch June 28, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants