Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion astrbot/core/platform/sources/satori/satori_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,6 +87,17 @@ async def send_with_adapter(
except Exception as e:
logger.error(f"语音转换为base64失败: {e}")

elif isinstance(component, Reply):
content_parts.append(f'<reply id="{component.id}"/>')

elif isinstance(component, Video):
try:
video_path_url = await component.convert_to_file_path()
if video_path_url:
content_parts.append(f'<video src="{video_path_url}"/>')
except Exception as e:
logger.error(f"视频文件转换失败: {e}")

content = "".join(content_parts)
channel_id = session_id
data = {"channel_id": channel_id, "content": content}
Expand Down Expand Up @@ -166,6 +177,17 @@ async def send(self, message: MessageChain):
except Exception as e:
logger.error(f"语音转换为base64失败: {e}")

elif isinstance(component, Reply):
content_parts.append(f'<reply id="{component.id}"/>')

elif isinstance(component, Video):
try:
video_path_url = await component.convert_to_file_path()
if video_path_url:
content_parts.append(f'<video src="{video_path_url}"/>')
except Exception as e:
logger.error(f"视频文件转换失败: {e}")

content = "".join(content_parts)
channel_id = self.session_id
data = {"channel_id": channel_id, "content": content}
Expand Down