feat(matrix): add missing Matrix constant and update docs#7368
feat(matrix): add missing Matrix constant and update docs#7368Soulter merged 2 commits intoAstrBotDevs:masterfrom
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
docs/zh/platform/matrix.md, the config item line formatrix_homeserverhas an extra trailing backtick in**matrix_homeserver(必填)**` which breaks the bold/inline-code formatting; please fix the markdown so the code span and bold are properly balanced. - The footnote line starting with
*:directly after the message type table indocs/zh/platform/matrix.mdwill be parsed as a list item in many markdown renderers; consider escaping the asterisk (e.g.,\*:) or rephrasing it as a separate paragraph to ensure it renders as a note.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `docs/zh/platform/matrix.md`, the config item line for `matrix_homeserver` has an extra trailing backtick in `**`matrix_homeserver` (必填)`**` which breaks the bold/inline-code formatting; please fix the markdown so the code span and bold are properly balanced.
- The footnote line starting with `*:` directly after the message type table in `docs/zh/platform/matrix.md` will be parsed as a list item in many markdown renderers; consider escaping the asterisk (e.g., `\*:`) or rephrasing it as a separate paragraph to ensure it renders as a note.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Matrix platform across the core system, dashboard, and documentation. Key changes include adding Matrix to the platform adapter types, updating the sender ID logic, and providing a new SVG logo and utility mappings in the dashboard. The documentation was also expanded with deployment details and configuration parameters. Review feedback highlighted minor typographical and formatting issues in the Chinese documentation that should be addressed for better clarity and consistency.
| ## 配置 | ||
|
|
||
| 请参考该仓库的 [README.md](https://github.com/stevessr/astrbot_plugin_matrix_adapter?tab=readme-ov-file#astrbot-matrix-adapter-%E6%8F%92%E4%BB%B6) 进行配置。 | ||
| - **`matrix_homeserver` (必填)`**: 你的 matrix 服务器实例的完整URL地址,支持域名委托自动探测。例如官方实例`https://matrix.org` |
There was a problem hiding this comment.
此处多了一个反引号,且建议使用全角逗号以符合中文文档规范。建议修改为:
- **matrix_homeserver(必填)**: 你的 Matrix 服务器实例的完整 URL 地址,支持域名委托自动探测。例如官方实例https://matrix.org` `
| 请参考该仓库的 [README.md](https://github.com/stevessr/astrbot_plugin_matrix_adapter?tab=readme-ov-file#astrbot-matrix-adapter-%E6%8F%92%E4%BB%B6) 进行配置。 | ||
| - **`matrix_homeserver` (必填)`**: 你的 matrix 服务器实例的完整URL地址,支持域名委托自动探测。例如官方实例`https://matrix.org` | ||
| - **`matrix_user_id`**: 你的 matrix 完整用户名。如 `@username:homeserver.com` | ||
| - **`matrix_auth_method` (必填)** : 你的登陆方式,可选`password`,`token`,`oauth2`,`qr`推荐使用`password`或`oauth2/qr`模式 (oauth2/qr 模式下请确保用于认证/扫码的设备回调可以访问到 astrbot 配置的公开地址) |
There was a problem hiding this comment.
Pull request overview
This PR fixes Matrix adapter events being incorrectly filtered by adding missing Matrix platform/type constants, and it updates the dashboard + Chinese docs to better surface/configure Matrix support.
Changes:
- Add
MATRIXtoPlatformAdapterTypeand map"matrix"to that type. - Add a Matrix-specific unique session-id builder in the waking check stage.
- Update dashboard platform utilities to include Matrix icon/tutorial link/display name, and add Matrix documentation + logo asset.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
astrbot/core/star/filter/platform_adapter_type.py |
Adds MATRIX enum flag, includes it in ALL, and maps "matrix" → PlatformAdapterType.MATRIX. |
astrbot/core/pipeline/waking_check/stage.py |
Adds Matrix session-id construction logic to avoid incorrect session filtering behavior. |
dashboard/src/utils/platformUtils.js |
Adds Matrix icon resolution, tutorial link, and display name mapping for the dashboard UI. |
dashboard/src/assets/images/platform_logos/matrix.svg |
Introduces a Matrix logo asset referenced by the dashboard. |
docs/zh/platform/matrix.md |
Expands Matrix docs with server info, supported message types, and basic configuration guidance. |
| - **`matrix_homeserver` (必填)`**: 你的 matrix 服务器实例的完整URL地址,支持域名委托自动探测。例如官方实例`https://matrix.org` | ||
| - **`matrix_user_id`**: 你的 matrix 完整用户名。如 `@username:homeserver.com` | ||
| - **`matrix_auth_method` (必填)** : 你的登陆方式,可选`password`,`token`,`oauth2`,`qr`推荐使用`password`或`oauth2/qr`模式 (oauth2/qr 模式下请确保用于认证/扫码的设备回调可以访问到 astrbot 配置的公开地址) |
There was a problem hiding this comment.
matrix_homeserver 这一行的 Markdown 代码格式不正确:(必填) 后多了一个反引号,导致加粗/代码样式渲染异常;同一段落里 matrix_auth_method 的冒号前后空格也不一致,且“登陆”建议统一为文档中常用的“登录”。建议统一修正这些格式与用词,避免文档显示错乱。
| - **`matrix_homeserver` (必填)`**: 你的 matrix 服务器实例的完整URL地址,支持域名委托自动探测。例如官方实例`https://matrix.org` | |
| - **`matrix_user_id`**: 你的 matrix 完整用户名。如 `@username:homeserver.com` | |
| - **`matrix_auth_method` (必填)** : 你的登陆方式,可选`password`,`token`,`oauth2`,`qr`推荐使用`password`或`oauth2/qr`模式 (oauth2/qr 模式下请确保用于认证/扫码的设备回调可以访问到 astrbot 配置的公开地址) | |
| - **`matrix_homeserver` (必填)**: 你的 matrix 服务器实例的完整URL地址,支持域名委托自动探测。例如官方实例`https://matrix.org` | |
| - **`matrix_user_id`**: 你的 matrix 完整用户名。如 `@username:homeserver.com` | |
| - **`matrix_auth_method` (必填)**: 你的登录方式,可选`password`,`token`,`oauth2`,`qr`推荐使用`password`或`oauth2/qr`模式 (oauth2/qr 模式下请确保用于认证/扫码的设备回调可以访问到 astrbot 配置的公开地址) |
| "satori": PlatformAdapterType.SATORI, | ||
| "misskey": PlatformAdapterType.MISSKEY, | ||
| "line": PlatformAdapterType.LINE, | ||
| "matrix": PlatformAdapterType.MATRIX, | ||
| } |
There was a problem hiding this comment.
在补充 matrix 映射的同时,建议也把 qq_official_webhook 加入 ADAPTER_NAME_2_TYPE(映射到 PlatformAdapterType.QQOFFICIAL 或单独 enum),否则 PlatformAdapterTypeFilter 对 webhook 适配器会直接返回 False,导致按 QQOFFICIAL 类型注册的 handler 在 webhook 模式下被错误过滤。
修复 matrix 适配器 的事件会在处理中会被错误地过滤的问题
初步修补 matrix 适配器 的配置文档
Modifications / 改动点
astrbot/core/pipeline/waking_check/stage.py
astrbot/core/star/filter/platform_adapter_type.py
补充了缺少的 matrix 相关定义( 此前可能导致框架视此平台为unknown,导致适配器不按照预期工作 )
docs/zh/platform/matrix.md
补充了 matrix 平台功能与 简单的配置
Screenshots or Test Results / 运行截图或测试结果
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Add full Matrix platform recognition and basic documentation to ensure the Matrix adapter behaves as a first-class supported platform.
New Features:
Enhancements: