Skip to content

Your lightweight open-source personal agent.

fix(feishu): convert audio type to file for API compatibility

Benbdfe7d6449da
diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py
index 0a0a5e492..a9a32b2bf 100644
--- a/nanobot/channels/feishu.py
+++ b/nanobot/channels/feishu.py
@@ -530,6 +530,10 @@ class FeishuChannel(BaseChannel):
self, message_id: str, file_key: str, resource_type: str = "file"
) -> tuple[bytes | None, str | None]:
"""Download a file/audio/media from a Feishu message by message_id and file_key."""
+ # Feishu API only accepts 'image' or 'file' as type parameter
+ # Convert 'audio' to 'file' for API compatibility
+ if resource_type == "audio":
+ resource_type = "file"
try:
request = (
GetMessageResourceRequest.builder()