{"id":51296314,"url":"https://github.com/zzttzzmyswy/astrbot-botapi-client","last_synced_at":"2026-06-30T15:00:44.004Z","repository":{"id":365840802,"uuid":"1274003660","full_name":"zzttzzmyswy/astrbot-botapi-client","owner":"zzttzzmyswy","description":"AstrBot BotAPI 客户端 — Android/Windows/Linux,流式 Markdown,多账户。需先装服务端插件 astrbot_plugin_botapi。","archived":false,"fork":false,"pushed_at":"2026-06-30T13:44:54.000Z","size":396,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-30T14:12:04.250Z","etag":null,"topics":["astrbot","botapi","chat","client","flutter"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzttzzmyswy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-19T05:03:59.000Z","updated_at":"2026-06-30T13:44:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zzttzzmyswy/astrbot-botapi-client","commit_stats":null,"previous_names":["zzttzzmyswy/astrbot-app","zzttzzmyswy/astrbot-botapi-client"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/zzttzzmyswy/astrbot-botapi-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzttzzmyswy%2Fastrbot-botapi-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzttzzmyswy%2Fastrbot-botapi-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzttzzmyswy%2Fastrbot-botapi-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzttzzmyswy%2Fastrbot-botapi-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzttzzmyswy","download_url":"https://codeload.github.com/zzttzzmyswy/astrbot-botapi-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzttzzmyswy%2Fastrbot-botapi-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34971621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astrbot","botapi","chat","client","flutter"],"created_at":"2026-06-30T15:00:26.828Z","updated_at":"2026-06-30T15:00:43.969Z","avatar_url":"https://github.com/zzttzzmyswy.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bot助手 — AstrBot BotAPI 客户端\n\n基于 Flutter 的 [AstrBot](https://github.com/Soulter/AstrBot) 移动 / 桌面客户端，通过 [astrbot_plugin_botapi](https://github.com/zzttzzmyswy/astrbot_plugin_botapi) 提供的 BotAPI 与自部署的 AstrBot 实例通信。\n\n\u003e ## ⚠️ 先装服务端插件\n\u003e 本应用是**客户端**，自身不能独立工作。使用前必须先在你的 AstrBot 服务端安装并启用插件 **[astrbot_plugin_botapi](https://github.com/zzttzzmyswy/astrbot_plugin_botapi)**（BotAPI 适配器），并在插件管理页生成一个 token。客户端用这个 token 连接。\n\u003e\n\u003e 插件安装与配置见插件仓库 README：\u003chttps://github.com/zzttzzmyswy/astrbot_plugin_botapi\u003e\n\n## 下载\n\n最新版本（Android APK / Linux AppImage / Windows 单文件 exe）见 [Releases](https://github.com/zzttzzmyswy/astrbot-botapi-client/releases)。\n\n| 平台 | 产物 | 用法 |\n| --- | --- | --- |\n| Android | `astrbot-vX.Y.Z.apk` | 安装 |\n| Linux x64 | `astrbot-linux-vX.Y.Z.AppImage` | `chmod +x \u0026\u0026 ./xxx.AppImage` |\n| Windows x64 | `astrbot-windows.exe` | 双击即运行（自解压） |\n\n## 功能特性\n\n- **多账户**：每个账户 = 一个 botapi token = 一个独立对话，账户间隔离。支持添加 / 重命名 / 切换 / 删除。\n- **多模态**：文本、语音（按住录制 / 拖动取消）、图片、文件发送与接收。\n- **流式 Markdown**：bot 回复边输出边渲染（标题 / 列表 / 代码块 / 表格 / 引用），无符号闪烁；消息内链接可点击，用系统默认浏览器打开。\n- **思考与工具调用**：`thinking` 折叠气泡、`tool_status` 系统气泡，与实时一致地持久化到历史。\n- **消息不丢**：SSE 实时 + 90s 空闲看门狗 + 恢复时历史合并 + 60s 周期对齐 + 回复后增量对齐，多层防漏。\n- **本地历史**：sqflite 持久化，按 `server_id` 去重，启动加载最近 50 条，SliverList 懒渲染。\n- **共享音频播放器**：单一播放器驱动所有语音气泡，滚动不中断、天然互斥、连续语音排队；可选自动播放。\n- **后台保活**（移动端）：前台服务 + 常驻通知，保持连接不断；国产 ROM 电池白名单引导。\n- **桌面单文件**：Linux AppImage、Windows 自解压 exe，下载即运行。\n- **暗黑模式**：跟随系统或手动。\n\n## 配置\n\n首次启动添加一个账户：\n\n- **服务器地址**：你的 AstrBot 实例地址，如 `https://your-host`。\n- **Token**：在服务端 [astrbot_plugin_botapi](https://github.com/zzttzzmyswy/astrbot_plugin_botapi) 管理页生成的 token。\n\n多账户可在左上角抽屉切换 / 管理。配置存本地，可在设置页修改。\n\n## 架构\n\n客户端走 BotAPI 五端点（详见 [插件 API 文档](https://github.com/zzttzzmyswy/astrbot_plugin_botapi/blob/main/docs/API.md)）：\n\n- `POST /auth` — token 鉴权\n- `POST /message` — 发消息\n- `POST /upload` — 上传媒体拿 file_id\n- `GET /stream?since=\u003cid\u003e` — SSE：实时 bot 回复（thinking / tool_status / text / media）\n- `GET /history?since=\u0026before=\u0026limit=` — 历史拉取与断连补漏\n\n```\nlib/\n├── models/            # account / botapi_event / history_row / message\n├── services/\n│   ├── botapi_http.dart       # /auth /message /upload /history (带重试)\n│   ├── botapi_client.dart     # SSE 流客户端 (解析 / 退避重连 / 空闲看门狗)\n│   ├── cache_service.dart     # sqflite 消息缓存 (server_id 去重 / 历史合并)\n│   ├── account_store.dart     # 多账户注册表\n│   ├── audio_playback_service.dart  # 共享播放器 + 队列\n│   ├── update_service.dart    # 版本检查 / 下载\n│   └── platform/              # 平台抽象:KeepAlive / Permission / UpdateApplier\n├── providers/         # chat / config / audio / platform_providers (Riverpod)\n├── screens/           # chat / setup / settings / account_editor\n├── widgets/           # account_drawer / attachment_panel / oem_whitelist_dialog\n└── util/              # retry / version / lru_cache / oem_whitelist\n```\n\n平台差异（前台保活、权限、更新安装）经 `lib/services/platform/` 的接口 + mobile/desktop 两套实现隔离，`Platform.is*` 只在 `platform_providers.dart` 出现一次，桌面安全降级、Android 不回归。\n\n## 构建\n\n\u003e 依赖 Flutter 3.38.x / Dart ≥ 3.2。\n\n```bash\nflutter pub get\n\n# Android\nflutter build apk --release --target-platform android-arm64\n\n# Linux 单文件 AppImage\nbash scripts/build-appimage.sh        # 产出 build/astrbot_app-x86_64.AppImage\n\n# Windows 单文件 exe\n# 由 CI(.github/workflows/build-windows.yml) 在 windows-latest 上用 NSIS 打包,\n# 推 v* tag 自动构建并挂 release。本机 Linux 无 MSVC,不能本地构建 Windows。\n```\n\n## 测试\n\n```bash\nflutter test      # 桌面平台实现、播放队列、消息模型等纯逻辑\nflutter analyze   # 0 error\n```\n\n## 许可\n\n[MIT License](LICENSE)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzttzzmyswy%2Fastrbot-botapi-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzttzzmyswy%2Fastrbot-botapi-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzttzzmyswy%2Fastrbot-botapi-client/lists"}