mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-27 21:35:51 +00:00
fix(feishu): support video (media) download by converting type to 'file'
Feishu's GetMessageResource API only accepts 'image' or 'file' as the type parameter. Video messages have msg_type='media', which was passed through unchanged, causing error 234001 (Invalid request param). Now both 'audio' and 'media' are converted to 'file' for download.
This commit is contained in:
parent
3003cb8465
commit
2cecaf0d5d
@ -815,9 +815,9 @@ class FeishuChannel(BaseChannel):
|
|||||||
"""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."""
|
||||||
from lark_oapi.api.im.v1 import GetMessageResourceRequest
|
from lark_oapi.api.im.v1 import GetMessageResourceRequest
|
||||||
|
|
||||||
# Feishu API only accepts 'image' or 'file' as type parameter
|
# Feishu resource download API only accepts 'image' or 'file' as type.
|
||||||
# Convert 'audio' to 'file' for API compatibility
|
# Both 'audio' and 'media' (video) messages use type='file' for download.
|
||||||
if resource_type == "audio":
|
if resource_type in ("audio", "media"):
|
||||||
resource_type = "file"
|
resource_type = "file"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user