Skip to content

Your lightweight open-source personal agent.

fix(feishu): support video (media) download by converting type to 'file'

chengyongru2cecaf0d5def
diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py
index 3ea05a3dc..1128c0e16 100644
--- a/nanobot/channels/feishu.py
+++ b/nanobot/channels/feishu.py
@@ -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: