{"id":20210513,"url":"https://github.com/lc-cn/onebots","last_synced_at":"2026-04-02T11:45:31.162Z","repository":{"id":39373540,"uuid":"506847145","full_name":"lc-cn/onebots","owner":"lc-cn","description":"基于icqq的多例oneBot管理应用","archived":false,"fork":false,"pushed_at":"2026-03-24T03:29:37.000Z","size":4525,"stargazers_count":203,"open_issues_count":0,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-24T06:54:46.447Z","etag":null,"topics":["chatbot","cqhttp","oicq","onebot","onebot11","onebot12"],"latest_commit_sha":null,"homepage":"http://onebots.pages.dev","language":"TypeScript","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/lc-cn.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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},"funding":{"github":"lc-cn","custom":["https://afdian.net/a/lc-cn","https://github.com/lc-cn/onebots#-赞助支持"]}},"created_at":"2022-06-24T01:59:42.000Z","updated_at":"2026-03-24T03:29:40.000Z","dependencies_parsed_at":"2023-02-09T14:32:48.331Z","dependency_job_id":"ef3fc39a-fede-4fdd-b9af-6426243aa71d","html_url":"https://github.com/lc-cn/onebots","commit_stats":{"total_commits":78,"total_committers":2,"mean_commits":39.0,"dds":0.02564102564102566,"last_synced_commit":"e83dd0ce30dd3362d3352f6092aac66375ef966a"},"previous_names":["liucl-cn/onebots","liucl-cn/oicq-onebot","lc-cn/onebots"],"tags_count":225,"template":false,"template_full_name":"l-collect/ts-dev-template","purl":"pkg:github/lc-cn/onebots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fonebots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fonebots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fonebots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fonebots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lc-cn","download_url":"https://codeload.github.com/lc-cn/onebots/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lc-cn%2Fonebots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chatbot","cqhttp","oicq","onebot","onebot11","onebot12"],"created_at":"2024-11-14T05:48:13.801Z","updated_at":"2026-04-02T11:45:31.157Z","avatar_url":"https://github.com/lc-cn.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\n# OneBots\n\n**A multi-platform, multi-protocol IM bot gateway and framework (TypeScript / Node.js)**\n\n*One `CommonEvent` abstraction, many platform adapters, many wire protocols (OneBot / Satori / Milky).*\n\n[![Build](https://github.com/lc-cn/onebots/actions/workflows/release.yml/badge.svg?branch=master\u0026event=push)](https://github.com/lc-cn/onebots/actions/workflows/release.yml)\n[![License](https://img.shields.io/github/license/lc-cn/onebots?color=blue)](https://github.com/lc-cn/onebots/blob/master/LICENSE)\n[![npm](https://img.shields.io/npm/v/onebots)](https://www.npmjs.com/package/onebots)\n[![Node](https://img.shields.io/node/v/onebots?color=339933\u0026logo=Node.js)](https://nodejs.org)\n[![Docker](https://img.shields.io/badge/docker-ghcr.io%2Flc--cn%2Fonebots-blue?logo=docker)](https://github.com/lc-cn/onebots/pkgs/container/onebots)\n\n**[Docs](https://onebots.pages.dev)** · **[中文 README](./README.md)** · **[Issues](https://github.com/lc-cn/onebots/issues)**\n\n\u003c/div\u003e\n\n---\n\n## What problem does it solve?\n\nYou often want:\n\n\u003e **One process talks to many IM platforms, and exposes one or more standard protocols to plugins or your own backend**—without rewriting glue code per platform.\n\nOneBots provides:\n\n| Layer | Role |\n|--------|------|\n| **Adapter** | Maps each platform’s events \u0026 APIs to **`CommonEvent` + shared Adapter APIs** |\n| **Protocol** | Turns `CommonEvent` into **OneBot v11/v12, Satori, Milky** wire formats and handles inbound API calls |\n| **`@onebots/core`** | Accounts, ID map (`createId` / `resolveId`), routing, protocol registry |\n| **`onebots` app** | Config, plugin loading, HTTP/WS gateway, optional **Web UI** |\n\n### Architecture (high level)\n\n```mermaid\nflowchart LR\n  subgraph IM[\"IM platforms\"]\n        A1[QQ / WeChat / Feishu / …]\n  end\n  subgraph OB[\"OneBots\"]\n        B[Adapter]\n        C[Account + id_map]\n        D[Protocol]\n  end\n  subgraph Down[\"Consumers\"]\n        E[OneBot clients]\n        F[Satori / Milky clients]\n        G[Your services]\n  end\n  A1 --\u003e B --\u003e C --\u003e D\n  D --\u003e E\n  D --\u003e F\n  D --\u003e G\n```\n\n---\n\n## Who it is / isn’t for\n\n**Good fit if you:**\n\n- Need **multiple IM platforms** and a **unified internal event model** before exporting to protocols\n- Want **multiple protocols on the same account** (e.g. OneBot + Satori) for different ecosystems\n- Prefer **Node.js ≥24 (`.node-version` recommended) / TypeScript** and a **self-hosted gateway**\n\n**Maybe not if you:**\n\n- Only target **one platform with one official SDK** (e.g. Discord.js only)—that can be simpler\n- Rely heavily on **Python stacks** (e.g. NoneBot plugins)—stay there or bridge explicitly\n\n---\n\n## Comparison (neutral)\n\n| Aspect | Raw platform SDKs | Other bot frameworks | **OneBots** |\n|--------|--------------------|----------------------|------------|\n| Multi-platform abstraction | DIY | Often yes | `CommonEvent` + adapters |\n| Multi-protocol export | DIY | Varies | Same account, multiple protocols |\n| Stack | Any | Often Python/TS | **TS / ESM / pnpm monorepo** |\n| Ecosystem size | — | Some larger | **Infrastructure-style**; grows with contributors |\n\n---\n\n## Features (summary)\n\n- **15+ adapters**: QQ official, ICQQ, WeChat OA, DingTalk, Feishu, WeCom, Telegram, Slack, Discord, Kook, Teams, Line, Email, WhatsApp, Zulip, Mock, …  \n- **Protocols**: OneBot v11/v12, Satori v1, Milky v1  \n- **Monorepo**: `pnpm workspace` (`packages/*`, `adapters/*`, `protocols/*`)  \n- **Optional Web UI**: `@onebots/web`  \n- **Client SDKs**: `imhelper` + `@imhelper/*`  \n- **Event flow**: `account.dispatch(commonEvent)` → each `protocol.dispatch`\n\n---\n\n## Quick start\n\n### A) Docker (recommended)\n\n**Mount a data volume** or config is lost on restart:\n\n```bash\ndocker run -d -p 6727:6727 -v $(pwd)/data:/data --name onebots ghcr.io/lc-cn/onebots:master\n```\n\nSee **[Docker guide](https://onebots.pages.dev/guide/docker)**.\n\n### B) npm + Mock (no real IM)\n\n`config.yaml` in the working directory (minimal example):\n\n```yaml\nport: 6727\nlog_level: info\n\ngeneral:\n  onebot.v11:\n    use_http: true\n    use_ws: true\n\nmock.demo:\n  onebot.v11:\n    use_http: true\n    use_ws: true\n```\n\n```bash\npnpm add onebots @onebots/adapter-mock @onebots/protocol-onebot-v11\nnpx onebots -r mock -p onebot-v11 -c config.yaml\n```\n\nWith an explicit subcommand, put **`-r` / `-p` / `-c` before `gateway`** (they attach to the root command):\n\n```bash\nnpx onebots -r mock -p onebot-v11 -c config.yaml gateway start\n```\n\nInvoking `npx onebots` **with no subcommand** starts the gateway in the foreground.\n\n**CLI flags** (see `App.loadAdapterFactory` / `App.loadProtocolFactory` in source):\n\n| Flag | Meaning | Examples | Resolved package |\n|------|---------|----------|------------------|\n| `-r \u003cname\u003e` | Adapter short name (`AdapterRegistry`) | `mock`, `kook`, `wechat` | `@onebots/adapter-\u003cname\u003e` → fallbacks |\n| `-p \u003cname\u003e` | Protocol suffix | `onebot-v11`, `onebot-v12`, `satori-v1`, `milky-v1` | `@onebots/protocol-\u003cname\u003e` → fallbacks |\n\n### C) From source\n\n```bash\ngit clone https://github.com/lc-cn/onebots.git\ncd onebots\npnpm install\npnpm dev\npnpm build \u0026\u0026 pnpm test\n```\n\n**Requires Node.js ≥ 22.**\n\n---\n\n## Production usage\n\n```bash\npnpm add onebots @onebots/adapter-\u003cplatform\u003e @onebots/protocol-\u003cprotocol\u003e\n```\n\nConfigure **`{platform}.{account_id}`** in `general` + per-account blocks. Full reference: **[documentation](https://onebots.pages.dev)**.\n\nStart:\n\n```bash\nnpx onebots -r kook -p onebot-v11 -c config.yaml\n```\n\nDownstream **imhelper** clients: **[Client SDK guide](https://onebots.pages.dev/guide/client-sdk)**.\n\n---\n\n## Repo layout\n\n- `packages/core` — `@onebots/core`  \n- `packages/onebots` — CLI \u0026 gateway  \n- `packages/web` — Web admin  \n- `packages/imhelper` — client SDK core  \n- `adapters/*` — `@onebots/adapter-*`  \n- `protocols/*` — `@onebots/protocol-*` + `@imhelper/*` SDKs  \n- `docs/` — VitePress source  \n\nMore: [packages/core/ARCHITECTURE.md](./packages/core/ARCHITECTURE.md)\n\n---\n\n## Contributing\n\n```bash\npnpm build\npnpm test\npnpm changeset\n```\n\n[CONTRIBUTING.md](./CONTRIBUTING.md)\n\n---\n\n## License\n\n[MIT](./LICENSE)\n\n---\n\n## Acknowledgements\n\n- [icqqjs/icqq](https://github.com/icqqjs/icqq)  \n- [takayama-lily/node-onebot](https://github.com/takayama-lily/node-onebot)  \n- [zhinjs/kook-client](https://github.com/zhinjs/kook-client)  \n- [zhinjs/qq-official-bot](https://github.com/zhinjs/qq-official-bot)  \n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nIf OneBots helps you, consider a ⭐ on [GitHub](https://github.com/lc-cn/onebots).\n\nMade with ❤️ by 凉菜 \u0026 contributors\n\n\u003c/div\u003e\n","funding_links":["https://github.com/sponsors/lc-cn","https://afdian.net/a/lc-cn","https://github.com/lc-cn/onebots#-赞助支持"],"categories":["🧰 指令列表"],"sub_categories":["📱 指令更新"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flc-cn%2Fonebots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flc-cn%2Fonebots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flc-cn%2Fonebots/lists"}