Skip to content

Fix/docs#8229

Open
lingyun14beta wants to merge 28 commits into
AstrBotDevs:masterfrom
lingyun14beta:fix/plugin-dev-docs
Open

Fix/docs#8229
lingyun14beta wants to merge 28 commits into
AstrBotDevs:masterfrom
lingyun14beta:fix/plugin-dev-docs

Conversation

@lingyun14beta
Copy link
Copy Markdown
Contributor

@lingyun14beta lingyun14beta commented May 18, 2026

持续修复中英文插件开发文档及平台文档中的多处错误和缺失内容。

Modifications / 改动点

以下这个env不知道为什么留着,故删除)
- docs/zh/dev/star/guides/env.md:删除未挂载的孤立文件
- docs/en/dev/star/guides/env.md:删除未挂载的孤立文件

  • docs/.vitepress/config.mjs:在英文侧边栏新增桌面客户端部署入口
  • docs/en/deploy/astrbot/desktop.md:新增英文桌面客户端部署页面
  • docs/en/dev/openapi.md:补充缺失的 Scope 权限说明、常用接口、message 字段格式等章节
  • docs/en/dev/star/guides/ai.md:补充 Multi-Agent 块缺少的 import;补充缺失的 add_message_pair 章节
  • docs/en/dev/star/guides/listen-message-event.md:补充缺失的 on_waiting_llm_request 钩子文档
  • docs/en/dev/star/guides/send-message.md:修复视频示例变量名 music → video
  • docs/en/dev/star/guides/simple.md:删除文件末尾多余的反引号
  • docs/en/index.md:更新 Trendshift 徽章仓库 ID(12875 → 21369)
  • docs/en/platform/discord.md:修复第 6 步图文排版错位
  • docs/en/platform/matrix.md:补充缺失的服务器部署、消息类型表格、完整配置说明等章节
  • docs/en/providers/ppio.md:删除不存在的 /tool off_all 指令引用
  • docs/en/use/function-calling.md:删除不存在的 /tool 指令列表
  • docs/zh/dev/star/guides/ai.md:补充 Multi-Agent 块缺少的 ToolSet、logger import
  • docs/zh/dev/star/guides/listen-message-event.md:修复 event.send() 传字符串而非 MessageChain 的问题
  • docs/zh/dev/star/guides/other.md:修复 AiocqhttpAdapter 导入路径;将废弃的 get_platform() 更新为 get_platform_inst()
  • docs/zh/dev/star/guides/send-message.md:修复视频示例变量名 music → video
  • docs/zh/dev/star/plugin.md:修复变量名笔误(provider → prov)、handler 缺少 async、Valueable → ValueError、删除不存在的 GEWECHAT、重复标点、SearchTool → HelloWorldTool
  • docs/zh/index.md:更新 Trendshift 徽章仓库 ID(12875 → 21369)
  • docs/zh/platform/discord.md:修复第 6 步图文排版错位
  • docs/zh/platform/matrix.md:修复表格备注行格式错误及加粗语法错误
  • docs/zh/providers/ppio.md:删除不存在的 /tool off_all 指令引用
  • docs/zh/use/function-calling.md:删除不存在的 /tool 指令列表
  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

这只是一个文档pr)


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.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Update and expand AstrBot documentation for OpenAPI, plugin development, platform adapters, and deployment, correcting inaccuracies and clarifying current behavior.

New Features:

  • Document scope-based API key permissions and message field formats in the OpenAPI docs.
  • Add an English guide for deploying AstrBot via the desktop client and expose it in the deployment sidebar.
  • Describe supported message types, server deployment, and configuration details for the Matrix platform adapter.

Bug Fixes:

  • Correct incorrect imports, async handlers, variable names, and exception types in Chinese plugin and AI guide examples so they match the current APIs.
  • Fix incorrect guidance about /tool CLI commands in function-calling and PPIO provider docs, directing users to WebUI-based tool management instead.
  • Resolve formatting issues in Discord and Matrix platform docs, including misplaced images, markdown errors, and extraneous backticks.
  • Ensure Multi-Agent examples in English and Chinese AI guides include required imports and tool definitions, and fix message hook examples to use the correct send patterns.

Enhancements:

  • Clarify usage of chat and IM message APIs, including proactive messaging and common endpoints, with structured examples.
  • Document the on_waiting_llm_request hook in both English and Chinese listen-message-event guides to explain its purpose and usage.
  • Align English and Chinese docs with the latest APIs for platform access (e.g., get_platform_inst, platform IDs) and plugin execution flow.
  • Update Trendshift badges and repository metadata on the English and Chinese index pages.

@auto-assign auto-assign Bot requested review from Fridemn and advent259141 May 18, 2026 16:53
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 18, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly updates the AstrBot documentation, introducing a new deployment guide for the Desktop Client, expanding the OpenAPI specification with scope permissions and message formats, and updating developer guides for AI tools and message events. It also transitions tool management instructions from CLI commands to the WebUI and corrects several code examples and typos across both English and Chinese versions. Feedback was provided regarding inconsistencies in the AI guide's imports and a potential NameError in code examples where Field was imported but used in lowercase.

Comment thread docs/en/dev/star/guides/ai.md Outdated
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The newly added Scope Permissions and message format sections in docs/en/dev/openapi.md are fairly detailed; it would be good to cross-check each documented scope and supported message segment type against the actual backend handlers to avoid future drift between docs and implementation.
  • In docs/zh/dev/star/guides/other.md, you now show both get_platform_inst (>= v4.0.0) and the deprecated get_platform usage; consider explicitly labeling the old snippet as deprecated with a short warning so readers don’t copy it into new plugins.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The newly added `Scope Permissions` and `message` format sections in `docs/en/dev/openapi.md` are fairly detailed; it would be good to cross-check each documented scope and supported message segment type against the actual backend handlers to avoid future drift between docs and implementation.
- In `docs/zh/dev/star/guides/other.md`, you now show both `get_platform_inst` (>= v4.0.0) and the deprecated `get_platform` usage; consider explicitly labeling the old snippet as deprecated with a short warning so readers don’t copy it into new plugins.

## Individual Comments

### Comment 1
<location path="docs/.vitepress/config.mjs" line_range="290" />
<code_context>
             collapsed: false,
             items: [
               { text: "Package Manager", link: "/astrbot/package" },
+              { text: "Desktop Client", link: "/astrbot/desktop" },
               { text: "One-click Launcher", link: "/astrbot/launcher" },
               { text: "Docker", link: "/astrbot/docker" },
</code_context>
<issue_to_address>
**issue (bug_risk):** Sidebar link path likely mismatches the new desktop doc location.

The doc lives at `docs/en/deploy/astrbot/desktop.md`, which should route to `/deploy/astrbot/desktop`, but this entry uses `/astrbot/desktop`, likely causing a 404. Please update the link (and any localized equivalents) to the correct path.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/.vitepress/config.mjs
@lingyun14beta
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request provides extensive updates to the AstrBot documentation, introducing a guide for the new Desktop Client and expanding the OpenAPI documentation with details on scope permissions and message formats. Developer guides were updated to reflect API changes in Multi-Agent tools, event hooks, and platform adapter retrieval, while user guides now emphasize WebUI-based tool management over CLI commands. Feedback from the review suggests ensuring internal links in English documentation use the correct language prefix and correcting a code example where certain variables were used without being defined.

Comment thread docs/en/deploy/astrbot/desktop.md Outdated
Comment thread docs/en/deploy/astrbot/desktop.md Outdated
Comment thread docs/en/dev/star/guides/ai.md
@lingyun14beta lingyun14beta changed the title Fix/plugin dev docs Fix/docs May 18, 2026
@lingyun14beta
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request provides extensive updates to the AstrBot documentation, including a new deployment guide for the Desktop Client and detailed OpenAPI specifications for scopes and message formats. Developer guides were updated to reflect API changes such as the on_waiting_llm_request hook, the use of ToolExecResult, and corrected Pydantic field usage. Furthermore, platform documentation for Matrix was expanded, and tool management instructions were transitioned from CLI commands to the WebUI. I have no feedback to provide.

@lingyun14beta lingyun14beta deleted the fix/plugin-dev-docs branch May 18, 2026 17:30
@lingyun14beta lingyun14beta restored the fix/plugin-dev-docs branch May 18, 2026 17:32
@lingyun14beta lingyun14beta reopened this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant