fix(feishu): use correct msg_type for audio/video files
This commit is contained in:
@@ -985,10 +985,13 @@ class FeishuChannel(BaseChannel):
|
|||||||
else:
|
else:
|
||||||
key = await loop.run_in_executor(None, self._upload_file_sync, file_path)
|
key = await loop.run_in_executor(None, self._upload_file_sync, file_path)
|
||||||
if key:
|
if key:
|
||||||
# Use msg_type "media" for audio/video so users can play inline;
|
# Use msg_type "audio" for audio, "video" for video, "file" for documents.
|
||||||
# "file" for everything else (documents, archives, etc.)
|
# Feishu requires these specific msg_types for inline playback.
|
||||||
if ext in self._AUDIO_EXTS or ext in self._VIDEO_EXTS:
|
# Note: "media" is only valid as a tag inside "post" messages, not as a standalone msg_type.
|
||||||
media_type = "media"
|
if ext in self._AUDIO_EXTS:
|
||||||
|
media_type = "audio"
|
||||||
|
elif ext in self._VIDEO_EXTS:
|
||||||
|
media_type = "video"
|
||||||
else:
|
else:
|
||||||
media_type = "file"
|
media_type = "file"
|
||||||
await loop.run_in_executor(
|
await loop.run_in_executor(
|
||||||
|
|||||||
Reference in New Issue
Block a user