Skip to content

Your lightweight open-source personal agent.

fix: ensure feishu audio file has .opus extension for Groq Whisper compatibility

chengyongru4044b85d4bfa
diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py
index a637025db..0409c32eb 100644
--- a/nanobot/channels/feishu.py
+++ b/nanobot/channels/feishu.py
@@ -753,8 +753,9 @@ class FeishuChannel(BaseChannel):
None, self._download_file_sync, message_id, file_key, msg_type
)
if not filename:
- ext = {"audio": ".opus", "media": ".mp4"}.get(msg_type, "")
- filename = f"{file_key[:16]}{ext}"
+ filename = file_key[:16]
+ if msg_type == "audio" and not filename.endswith(".opus"):
+ filename = f"{filename}.opus"
if data and filename:
file_path = media_dir / filename