nonebot2 is a free, open source ai interaction & interfaces project written in Python and released under MIT. It has 7,778 GitHub stars, 662 forks and 39 open issues, and was last pushed 3 days ago. On this registry it ranks #51 of 156 tracked projects in AI Interaction & Interfaces, with 5 head-to-head comparisons available. It gained 50 stars over the last 30 tracked days.

What is nonebot2?

NoneBot2 is a cross-platform, asynchronous chatbot framework written in Python, built for developers who want one codebase to serve bots across many chat platforms instead of rewriting integration glue for each one.

What it is

NoneBot2 is a modern, extensible Python framework for chat bots, built on Python's type annotations and asynchronous features. The project lives in the Python ecosystem and is distributed under the MIT licence; its registry topics include bot, chatbot, cqhttp, onebot, mirai-bot, lark-bot, dingtalk-robot and fastapi. The framework separates bot logic from platform plumbing through an adapter layer, so an application is written once while the adapter handles the protocol of the chat service the bot is talking to. Protocol support is extensible: adapters ship both inside the project and as separate repositories, and the framework allows custom communication protocols to be defined.

The concrete problem it solves is per-platform bot code. Without an abstraction layer, a developer targeting QQ, Telegram and Feishu would maintain three unrelated integrations with different authentication, event models and message formats. NoneBot2 replaces that duplication with one application surface and swappable adapters — the OneBot adapter alone covers QQ, Telegram, WeChat official accounts and KOOK, and the Satori adapter covers OneBot, Telegram, Feishu, WeChat official accounts and Koishi. The framework also removes the boilerplate around async event handling, which is where the "asynchronous first" design matters: the README states that even very large message volumes are handled comfortably.

Key capabilities

  • Adapter matrix covering OneBot, Telegram, Feishu, GitHub, QQ, Console, Red, Satori, Discord, DoDo, Kritor, Mirai and Milky, each in its own repository with a specification link.
  • GitHub adapter supports both GitHub APP and OAuth APP authentication.
  • Console adapter provides console-based interaction for development and testing.
  • Satori adapter bridges OneBot, Telegram, Feishu, WeChat official accounts and Koishi through one protocol.
  • 100% type annotation coverage, which lets editor type inference catch most bugs before runtime, as described on the project's editor support page.
  • NB-CLI scaffolding that keeps generated code free of unnecessary boilerplate so developers focus on business logic.
  • Community-contributed adapters extend reach to Rocket.Chat, Tailchat, Mail, Minecraft, Ntchat, Walle-Q, VoceChat and Bilibili live rooms.

Who uses it and how

  • QQ bot developers, who connect through OneBot, Mirai, Red for the QQNT protocol, Milky for the QQNT bot application interface standard, or Kritor, also known as OnebotX.
  • Teams building assistant bots inside workplace chat, using the Feishu adapter, the WeChat official account adapters, or DingTalk, whose official adapter is currently marked as unavailable and seeking a maintainer.
  • Community-server operators running Discord bots or DoDo bots from the same application code.
  • Developers who need one bot across several ecosystems at once, typically via Satori or OneBot rather than one adapter per platform.
  • The README reports more than one hundred thousand direct and indirect users, with large numbers of active users daily.

Getting started

Start from the project documentation at nonebot.dev, which includes a quickstart guide and a note on what to do when the documentation will not open. Development is scaffolded through NB-CLI, which generates the project skeleton so business logic can be written directly.

How it compares

The same space contains Mirai, a QQ protocol library reachable through the dedicated Mirai adapter, OneBot as a protocol standard with its own adapter, and Koishi, which NoneBot2 can reach through the Satori adapter. NoneBot2 differs from those by being the Python asynchronous framework around the protocols rather than a single protocol implementation or a JavaScript runtime. Adapter repositories keep that protocol work separable, so a bot keeps working when one platform is swapped.

When to use it — and when not to

Choose NoneBot2 when the bot logic is written in Python and needs to survive across multiple chat platforms, since the adapter boundary is where the project's value sits. Self-hosters should expect to run and maintain the chosen adapter themselves, and should check adapter status first: Villa is offline because the official Bot protocol was retired, Gewechat is no longer maintained or available, and DingTalk's adapter is looking for a maintainer. The documented caveat that QQ official interfaces change frequently is the clearest ongoing risk, and community-contributed adapters carry no compatibility promise.

project readme (upstream, from github) — read inline

nonebot

NoneBot

✨ 跨平台 Python 异步机器人框架 ✨

license pypi python black pyright ruff
codecov site pre-commit pyright ruff
onebot onebot QQ telegram feishu github
QQ Chat Group QQ Channel Telegram Channel Discord Server

文档 · 快速上手 · 文档打不开?

setup

简介

NoneBot2 是一个现代、跨平台、可扩展的 Python 聊天机器人框架,它基于 Python 的类型注解和异步特性,能够为你的需求实现提供便捷灵活的支持。

特色

  • 异步优先:基于 Python 的异步特性,即使是非常大量的消息,也能吞吐自如

  • 易于开发:配合 NB-CLI 脚手架,代码编写上手简单,没有过多的冗余代码,可以让开发者专注于业务逻辑

  • 生而可靠:100% 类型注解覆盖,配合编辑器的类型推导功能,能将绝大多数的 Bug 杜绝在编辑器中 (编辑器支持)

  • 社区丰富:社区用户众多,直接和间接用户超过十万人,每天都有大量的活跃用户 (社区资源)

  • 海纳百川:一个框架,支持多个聊天软件平台,可自定义通信协议

    协议名称 状态 注释
    OneBot(仓库,协议) ✅ 支持 QQ、TG、微信公众号、KOOK 等平台
    Telegram(仓库,协议) ✅
    飞书(仓库,协议) ✅
    GitHub(仓库,协议) ✅ GitHub APP & OAuth APP
    QQ(仓库,协议) ✅ QQ 官方接口调整较多
    Console(仓库) ✅ 控制台交互
    Red(仓库,协议) ✅ QQNT 协议
    Satori(仓库,协议) ✅ 支持 Onebot、TG、飞书、微信公众号、Koishi 等
    Discord(仓库,协议) ✅ Discord Bot 协议
    DoDo(仓库,协议) ✅ DoDo Bot 协议
    Kritor(仓库,协议) ✅ Kritor (OnebotX) 协议,QQNT 机器人接口标准
    Mirai(仓库,协议) ✅ QQ 协议
    Milky(仓库,协议) ✅ QQNT 机器人应用接口标准
    钉钉(仓库,协议) 🤗 寻找 Maintainer(暂不可用)
    开黑啦(仓库,协议) ↗️ 由社区贡献
    Ntchat(仓库) ↗️ 微信协议,由社区贡献
    MineCraft(仓库) ↗️ 由社区贡献
    Walle-Q(仓库) ↗️ QQ 协议,由社区贡献
    Villa(仓库) ❌ 米游社大别野 Bot 协议,官方已下线
    Rocket.Chat(仓库,协议) ↗️ Rocket.Chat Bot 协议,由社区贡献
    Tailchat(仓库,协议) ↗️ Tailchat 开放平台 Bot 协议,由社区贡献
    Mail(仓库) ↗️ 邮件收发协议,由社区贡献
    黑盒语音(仓库,协议) ↗️ 黑盒语音机器人协议,由社区贡献
    微信公众平台(仓库,协议) ↗️ 微信公众平台协议,由社区贡献
    WxClaw(仓库,协议) ↗️ 微信智能体协议,由社区贡献
    Gewechat(仓库,协议) ❌ Gewechat 微信协议,Gewechat不再维护及可用
    EFChat(仓库,协议) ↗️ 恒五聊平台协议,由社区贡献
    VoceChat (仓库,协议) ↗️ VoceChat 平台协议,由社区贡献
    B站直播间(仓库,Web API 协议,开放平台协议) ↗️ B站直播间(Web API/开放平台)协议,由社区贡献
    Matrix (仓库,协议) ↗️ Matrix 协议,由社区贡献
  • 坚实后盾:支持多种 web 框架,可自定义替换、组合

    驱动框架 类型
    FastAPI 服务端
    Quart(异步 Flask) 服务端
    aiohttp 客户端
    httpx 客户端
    httpx2 客户端
    websockets 客户端

更多:概览

什么不是 NoneBot2

NoneBot2 不是某个平台或者协议的具体实现,它只负责和已有协议适配器通信,并处理接收到的事件。所以,“NoneBot 有 blabla 平台的 blabla 功能吗?”这种问题是与 NoneBot2 无关的。请在相应平台的功能文档中确认,或与相应平台的协议适配开发者联系。

NoneBot2 不是 NoneBot1 的替代品。事实上,它们都在被积极的维护着。但是,如果你想尝试一些新功能,或者想要支持更多的平台,可以考虑使用 NoneBot2。

NoneBot2 和 NoneBot1 的区别,就像是 VisualStudio Code 和 VisualStudio 一样

即刻开始

完整文档可以在 这里 查看。

懒得看文档?下面是快速安装指南:

  1. 安装 pipx

    python -m pip install --user pipx
    python -m pipx ensurepath
    
  2. 安装脚手架

    pipx install nb-cli
    
  3. 使用脚手架创建项目

    nb create
    
  4. 运行项目

    nb run
    

社区资源

常见问题

教程/实际项目/经验分享

插件

此外,NoneBot2 还有丰富的官方以及第三方现成的插件供大家使用:

许可证

NoneBot 采用 MIT 许可证进行开源

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

贡献

请参考 贡献指南

鸣谢

赞助者

感谢以下产品对 NoneBot 项目提供的赞助:

GitHub

    

netlify

    

sentry

docker

    

algolia

JetBrains

感谢以下赞助者对 NoneBot 项目提供的资金支持:

sponsors

开发者

感谢以下开发者对 NoneBot2 作出的贡献:

contributors

Frequently asked questions

Is nonebot2 free to use?

nonebot2 is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does nonebot2 do?

跨平台 Python 异步聊天机器人框架 / Asynchronous multi-platform chatbot framework written in Python

What is nonebot2 written in?

nonebot2 is primarily written in Python. Its source is publicly available at https://github.com/nonebot/nonebot2, and it has 7,778 GitHub stars.