fix: treat QQ content_type "voice" as a voice message#72
Merged
Conversation
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
approved these changes
Jun 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
content_type: "voice"(not a standardaudio/*MIME). The old_att_labelonly matchedaudio/*, so every voice message was mislabeled as "文件" and theasr_refer_textlookup added in feat: prefer QQ platform asr_refer_text for voice transcription #71 never ran._is_voice(att)acceptingcontent_type == "voice", anaudio/*prefix, a non-emptyasr_refer_text, or voice file extensions (.amr/.silk/.slk/.slac). Both_att_labeland_download_attsnow use it.isVoiceAttachmentin tencent-connect/openclaw-qqbot.Test plan
ruff check+ syntax check passasr_refer_text(can't reproduce locally — needs a live QQ voice event through the gateway)🤖 Generated with Claude Code