Merge PR #1531: fix(feishu): convert audio type to file for API compatibility

fix(feishu): convert audio type to file for API compatibility
This commit is contained in:
Xubin Ren
2026-03-05 00:38:15 +08:00
committed by GitHub

View File

@@ -530,6 +530,10 @@ class FeishuChannel(BaseChannel):
self, message_id: str, file_key: str, resource_type: str = "file" self, message_id: str, file_key: str, resource_type: str = "file"
) -> tuple[bytes | None, str | None]: ) -> tuple[bytes | None, str | None]:
"""Download a file/audio/media from a Feishu message by message_id and file_key.""" """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: try:
request = ( request = (
GetMessageResourceRequest.builder() GetMessageResourceRequest.builder()