From 9119f7166f3443973fc0e28a8beb59b0c43d8b91 Mon Sep 17 00:00:00 2001
From: shangxue <1919892171@qq.com>
Date: Wed, 15 Oct 2025 10:45:35 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20satori=20=E9=80=82=E9=85=8D=E5=99=A8?=
=?UTF-8?q?=E6=94=AF=E6=8C=81=20video=E3=80=81reply=20=E6=B6=88=E6=81=AF?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=20(#3035)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Update satori_event.py
* style: format
---------
Co-authored-by: Soulter <905617992@qq.com>
---
.../platform/sources/satori/satori_event.py | 24 ++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/astrbot/core/platform/sources/satori/satori_event.py b/astrbot/core/platform/sources/satori/satori_event.py
index c90fa3af6..f1a66da6b 100644
--- a/astrbot/core/platform/sources/satori/satori_event.py
+++ b/astrbot/core/platform/sources/satori/satori_event.py
@@ -2,7 +2,7 @@ from typing import TYPE_CHECKING
from astrbot.api import logger
from astrbot.api.event import AstrMessageEvent, MessageChain
from astrbot.api.platform import AstrBotMessage, PlatformMetadata
-from astrbot.api.message_components import Plain, Image, At, File, Record
+from astrbot.api.message_components import Plain, Image, At, File, Record, Video, Reply
if TYPE_CHECKING:
from .satori_adapter import SatoriPlatformAdapter
@@ -87,6 +87,17 @@ class SatoriPlatformEvent(AstrMessageEvent):
except Exception as e:
logger.error(f"语音转换为base64失败: {e}")
+ elif isinstance(component, Reply):
+ content_parts.append(f'')
+
+ elif isinstance(component, Video):
+ try:
+ video_path_url = await component.convert_to_file_path()
+ if video_path_url:
+ content_parts.append(f'')
+ except Exception as e:
+ logger.error(f"视频文件转换失败: {e}")
+
content = "".join(content_parts)
channel_id = session_id
data = {"channel_id": channel_id, "content": content}
@@ -166,6 +177,17 @@ class SatoriPlatformEvent(AstrMessageEvent):
except Exception as e:
logger.error(f"语音转换为base64失败: {e}")
+ elif isinstance(component, Reply):
+ content_parts.append(f'')
+
+ elif isinstance(component, Video):
+ try:
+ video_path_url = await component.convert_to_file_path()
+ if video_path_url:
+ content_parts.append(f'')
+ except Exception as e:
+ logger.error(f"视频文件转换失败: {e}")
+
content = "".join(content_parts)
channel_id = self.session_id
data = {"channel_id": channel_id, "content": content}