fix(whatsapp): send voice replies as native audio attachments - #9687
Closed
sqsge wants to merge 1 commit into
Closed
fix(whatsapp): send voice replies as native audio attachments#9687sqsge wants to merge 1 commit into
sqsge wants to merge 1 commit into
Conversation
Contributor
Collaborator
|
Likely duplicate of #13002 — same WhatsApp send_voice() fix already merged. |
Collaborator
|
Likely duplicate of #13002 |
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
This PR adds a WhatsApp-specific
send_voice()override so voice replies are sent through the existing native media path instead of falling back to the base text placeholder behavior.Why
The WhatsApp bridge already supports sending
audiomedia payloads.However, the Python WhatsApp adapter did not override
send_voice(), so voice replies fell back to the base platform implementation, which sends a text placeholder like🔊 Audio: <path>instead of a native media attachment.This change stays intentionally narrow and wires the missing adapter method into the existing WhatsApp media-send path.
Changes
send_voice()override toWhatsAppAdapter_send_media_to_bridge(chat_id, audio_path, "audio", caption)send_voice()forwards the correct media type and captionFixes #9236
Testing
I added a regression test in
tests/gateway/test_whatsapp_connect.pycovering the adapter behavior directly.In this local environment, the repository test suite for this file could not be run end-to-end because
pytest-asyncioand some defaultpytestaddopts dependencies are not installed here.To reduce that risk, I verified the change with:
send_voice()forwards to the "audio" media path