feat: satori 适配器支持 video、reply 消息类型 #3035
Merged
+23
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / 动机
此项更改旨在增强 Satori 适配器对多媒体消息类型的支持。
在之前的版本中,Satori 适配器无法正确处理或发送视频 (Video) 和回复 (Reply) 消息类型。
Modifications / 改动点
本次改动主要集中在
SatoriPlatformEvent类中,具体修改了send_with_adapter和send方法。核心改动点包括:
Video消息组件的判断和处理。当遇到Video组件时,会将其转换为文件路径 URL,并生成 Satori 的<video src="{video_path_url}"/>标签。Reply消息组件的判断和处理。当遇到Reply组件时,会生成 Satori 的<reply id="{component.id}"/>标签,以支持消息回复功能。Compatibility & Breaking Changes / 兼容性与破坏性变更
此项改动是功能增强,仅在 Satori 适配器中增加了对
Video和Reply消息组件的处理逻辑。它不会影响现有功能的行为,也不引入任何破坏性变更。所有旧的消息类型和发送方式仍然兼容。
Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Sourcery 总结
增强 Satori 适配器,使其发送方法能够处理视频 (Video) 和回复 (Reply) 消息类型,从而为这些组件生成适当的媒体标签。
新功能:
<video>标签<reply>标签Original summary in English
Summary by Sourcery
Enhance Satori adapter to handle Video and Reply message types in its send methods, enabling proper media tag generation for these components
New Features: