Merge PR #1741: fix: ensure feishu audio file has .opus extension for Groq Whisper compatibility

fix: ensure feishu audio file has .opus extension for Groq Whisper compatibility
This commit is contained in:
Xubin Ren 2026-03-10 00:26:30 +08:00 committed by GitHub
commit 81b22a9e3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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