fix(gateway): pass message_thread_id in send_image_file, send_document, send_video#1809
Closed
unmodeled-tyler wants to merge 1 commit into
Closed
Conversation
…t, send_video Fixes NousResearch#1803. send_image_file, send_document, and send_video were missing message_thread_id forwarding, causing them to fail in Telegram forum/supergroups where thread_id is required. send_voice already handled this correctly. Adds metadata parameter + message_thread_id to all three methods, and adds tests covering the thread_id forwarding path.
Contributor
Author
|
The CI failures are pre-existing and unrelated to this PR:
This PR only touches |
Contributor
|
Merged via PR #2339 — cherry-picked with authorship preserved. Clean fix matching the existing send_voice pattern. Thanks! |
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
Fixes #1803 — media files (images, documents, videos) sent via
MEDIA:tags failed in Telegram forum groups/supergroups with Topics enabled.send_image_file,send_document, andsend_videowere not forwardingmessage_thread_idto the Telegram Bot APIsend_voicealready handled this correctly via an explicitmetadataparametermessage_thread_idis required to post to a topic; omitting it causes the API call to failChanges:
metadata: Optional[Dict[str, Any]] = Noneparameter to all three methodsthread_idfrom metadata and pass it asmessage_thread_id(matching the pattern insend_voice)thread_idforwarding path inTestSendDocument,TestSendVideo, andTestTelegramSendImageFileTest plan
pytest tests/gateway/test_telegram_documents.py tests/gateway/test_send_image_file.py -v— all 54 tests passMEDIA:tag in a Telegram forum group with Topics — file should arrive in the correct topic threadthread_idin metadata →message_thread_id=None→ no-op)Platform tested: Linux