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:
chengyongru 2026-04-04 01:36:44 +08:00
parent 791282fc75
commit 59152877af

View File

@ -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: