nonebot2
An asynchronous python bot framework.
What it is and what it does
NoneBot2 is a modern asynchronous Python chatbot framework designed to run bots across multiple messaging platforms—QQ, Telegram, Discord, Feishu, GitHub, and others—through a unified adapter architecture. It uses Python's async/await syntax and type annotations to let developers write bot logic once and deploy it to different platforms by swapping protocol adapters. The framework handles message routing, event dispatch, and lifecycle management, while developers focus on writing command handlers and business logic.
The framework depends on nine runtime libraries including pydantic for configuration validation, loguru for logging, anyio for async compatibility, and yarl for URL handling. It ships as a pure-Python wheel with low installation friction. The project is actively maintained with a large community and production-stable status. It supports multiple web frameworks (FastAPI, Quart, aiohttp, httpx, websockets) as underlying drivers, allowing customization of the transport layer.
Use it for:
- Build a QQ bot that responds to commands and forwards messages using OneBot protocol
- Create a Telegram bot with the same codebase and deploy it to Discord by switching adapters
- Develop a GitHub bot that reacts to pull requests and issues using the GitHub adapter
- Run a bot on Feishu or DoDo platforms without rewriting core logic for each platform
- Prototype a chatbot locally using the Console adapter, then deploy to production with a real messaging platform
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
NoneBot2 is an asynchronous Python framework for building chatbots that connect to multiple messaging platforms through pluggable protocol adapters.
Yes. NoneBot2 is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers a genuine multi-platform abstraction for bot development. Install it if you need to build bots for multiple messaging platforms or want async-first Python bot development with strong type safety. The main constraint is Python 3.10 or later requirement.
Install
nonebot2 on PyPI
pip
pip install nonebot2uv
uv add nonebot2poetry
poetry add nonebot2Installing nonebot2
Before you install
Low friction installation with a pure-Python wheel. Active maintenance with recent commits and a stable release cycle; last commit 2026-08-14 and latest release 2026-04-01. Requires Python 3.10 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for both open-source and proprietary bot projects.
Quickstart
pip install nonebot2
from nonebot import on_message
from nonebot.adapters import Message
@on_message()
async def handle(msg: Message):
pass
Requires Python 3.10 or later; asyncio event loop must be running to execute bot handlers.
Verify before relying
- Whether type annotation coverage is verified by static analysis tooling
- Performance characteristics under high message throughput
- Whether community-contributed adapters receive the same maintenance as official ones
- Specific platforms and protocols supported beyond those listed in the description excerpt
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — yarl, anyio, loguru, pygtrie, exceptiongroup, python-dotenv, typing-extensions, tomli, pydantic |
| Maintenance | actively maintained — 135 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 103,293/month — #12,816 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: nonebot2-2.5.0-py3-none-any.whl
Keywords: bot, qq, qqbot, mirai, coolq
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
qq-botpyA Python framework for building QQ chat bots…
permissive · top 15,000 on PyPI
aiogramaiogram is an asynchronous Python framework for…
permissive · top 5,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI
TelethonTelethon is an asyncio-based Python library…
permissive · top 5,000 on PyPI
pyroforkPyrofork is an asynchronous Python framework…
copyleft · top 15,000 on PyPI
PyrogramPyrogram is an asynchronous Python framework…
copyleft · top 15,000 on PyPI
KurigramKurigram is an asynchronous Python framework…
copyleft · top 15,000 on PyPI
noneA library providing additional utilities and…
permissive · top 15,000 on PyPI
telebotA Telegram bot library with route-based message…
permissive · top 15,000 on PyPI