mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-05 10:52:36 +00:00
fix(feishu): support video (media) download by converting type to 'file'
Feishu's GetMessageResource API only accepts 'image' or 'file' as the type parameter. Video messages have msg_type='media', which was passed through unchanged, causing error 234001 (Invalid request param). Now both 'audio' and 'media' are converted to 'file' for download.
This commit is contained in:
parent
791282fc75
commit
59152877af
@ -815,9 +815,9 @@ class FeishuChannel(BaseChannel):
|
||||
"""Download a file/audio/media from a Feishu message by message_id and file_key."""
|
||||
from lark_oapi.api.im.v1 import GetMessageResourceRequest
|
||||
|
||||
# Feishu API only accepts 'image' or 'file' as type parameter
|
||||
# Convert 'audio' to 'file' for API compatibility
|
||||
if resource_type == "audio":
|
||||
# Feishu resource download API only accepts 'image' or 'file' as type.
|
||||
# Both 'audio' and 'media' (video) messages use type='file' for download.
|
||||
if resource_type in ("audio", "media"):
|
||||
resource_type = "file"
|
||||
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user