Files
AstrBot/docs/zh/dev/star/plugin-publish.md
Soulter 695a9bd915 feat: show plugin contributors and project links in details (#11495)
* feat: show plugin authors and project links in details

* feat: group plugin author email under contact

* feat: show author and plugin homepages in details

* chore: trim plugin metadata docs and tests

* feat: show plugin funding links in details

* docs: clarify plugin author display precedence

* feat: use contributors for plugin credits

* docs: show all supported plugin funding platforms

* docs: clarify that plugin authors can be listed as contributors
2026-12-01 20:57:00 +08:00

4.1 KiB

发布插件到插件市场

在编写完插件后,你可以选择将插件发布到 AstrBot 的插件市场,让更多用户使用你的插件。

AstrBot 使用 GitHub 托管插件,因此你需要先将插件代码推送到之前创建的 GitHub 插件仓库中。

你可以前往 AstrBot 插件发布页面 发布你的插件,发布插件需要注册 AstrBot Cloud 账号。

以下是一个完整的插件元数据示例(metadata.yaml),系统会自动解析这些信息:

name: astrbot_plugin_example                 # 插件标识符,英文,唯一
display_name: 示例插件名称                    # 插件展示名称
# short_desc: 一句话介绍你的插件功能           # (可选)紧凑 UI 使用的短描述
desc: |                                     # 详细描述插件的信息
  详细描述插件的功能、特性、使用方法等信息。
  可以写多行文本,支持 Markdown 格式。
version: 1.0.0                               # 插件版本号(遵循语义化版本规范)
author: your-name                           # 必填,非空字符串。与 name 共同组成插件 ID,请保持稳定。
repo: https://github.com/your-name/repo      # 插件仓库地址
# 详情页优先按顺序显示 contributors。省略 contributors 或没有有效条目时,显示 author。
# contributors:                             # (可选)可列出插件作者和其他贡献者
#   - name: Alice                            # 每项必填
#     contact:                               # (可选)公开邮箱和 HTTPS 主页均可省略
#       email: plugins@example.org
#       homepage: https://alice.example.org
#   - name: Bob
# links:                                    # (可选)项目链接,使用 HTTPS
#   homepage: https://example.org/plugin
#   issues: https://github.com/your-name/repo/issues
#   documentation: https://example.org/docs
#   community: https://example.org/community
#   funding:                                # (可选)赞助链接,每个平台一个地址
#     github: https://github.com/sponsors/your-name
#     afdian: https://afdian.com/a/your-name
#     open_collective: https://opencollective.com/your-project
#     buy_me_a_coffee: https://buymeacoffee.com/your-name
#     patreon: https://www.patreon.com/your-name
#     ko_fi: https://ko-fi.com/your-name
#     custom:                               # 其他赞助链接列表
#       - https://example.org/support
# category: utility                          # (可选)插件市场分类 ID
# astrbot_version: ">=4.17.0"                # (可选)支持的 AstrBot 版本范围
# support_platforms:                         # (可选)支持的平台适配器列表
#   - aiocqhttp
#   - qq_official
# social_link: https://github.com/your-web   # (可选)你的个人网站、GitHub 主页等
# tags:                                      # (可选)标签列表,用于插件市场搜索
  # - example

目前支持的平台适配器

推荐的插件市场分类

::: warning 大小限制 发布到插件市场的插件压缩包(zip)大小不得超过 16MB。

如果超过此限制,CI/CD 流水线将自动拒绝该发布请求。 ::: details 为确保你的插件能顺利通过审核和发布,建议采取以下措施:

  • 压缩图片等静态资源:对插件中的图片、音频等资源文件进行压缩,减小体积。
  • 清理不必要的文件:避免将 .git 目录、__pycache__、node_modules、开发用配置文件等非必需文件提交到插件仓库中。建议在仓库根目录添加 .gitignore 来排除它们。
  • 优化依赖体积:如果插件包含体积较大的依赖库,可考虑精简或按需引入。
  • 使用 .gitattributes 或发布分支:通过只包含发布所需文件的策略来减小 zip 包体积。

如果插件确实因业务需要无法压缩到 16MB 以内,可以联系维护者手动 bypass 此限制。 :::