From 4f7b1193353e4dd2da36628d8dc98d74781eaffe Mon Sep 17 00:00:00 2001
From: shangxue <1919892171@qq.com>
Date: Tue, 14 Oct 2025 14:40:26 +0800
Subject: [PATCH 1/2] Update satori_event.py
---
.../platform/sources/satori/satori_event.py | 28 ++++++++++++++++++-
1 file changed, 27 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..627806189 100644
--- a/astrbot/core/platform/sources/satori/satori_event.py
+++ b/astrbot/core/platform/sources/satori/satori_event.py
@@ -2,7 +2,7 @@
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,19 @@ async def send_with_adapter(
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 +179,19 @@ async def send(self, message: MessageChain):
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}
From e061e3d64455d65c42ca69e4260aa37c4f1ea01a Mon Sep 17 00:00:00 2001
From: Soulter <905617992@qq.com>
Date: Wed, 15 Oct 2025 10:44:44 +0800
Subject: [PATCH 2/2] style: format
---
astrbot/core/platform/sources/satori/satori_event.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/astrbot/core/platform/sources/satori/satori_event.py b/astrbot/core/platform/sources/satori/satori_event.py
index 627806189..f1a66da6b 100644
--- a/astrbot/core/platform/sources/satori/satori_event.py
+++ b/astrbot/core/platform/sources/satori/satori_event.py
@@ -94,9 +94,7 @@ async def send_with_adapter(
try:
video_path_url = await component.convert_to_file_path()
if video_path_url:
- content_parts.append(
- f''
- )
+ content_parts.append(f'')
except Exception as e:
logger.error(f"视频文件转换失败: {e}")
@@ -186,9 +184,7 @@ async def send(self, message: MessageChain):
try:
video_path_url = await component.convert_to_file_path()
if video_path_url:
- content_parts.append(
- f''
- )
+ content_parts.append(f'')
except Exception as e:
logger.error(f"视频文件转换失败: {e}")