skillfed

nonebot2

An asynchronous python bot framework.

nonebot2 v2.5.0 103.3K downloads/30d#12,816 on PyPI7,664
Permissive license MIT Active released

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 nonebot2

uv

uv add nonebot2

poetry

poetry add nonebot2

Installing 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

Development Status :: 5 - Production/StableFramework :: Robot FrameworkFramework :: Robot Framework :: LibraryOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

async python bot frameworkmulti-platform chatbotqq bot frameworktelegram bot pythonprotocol adapter botpython async messagingcross-platform bot framework
async-frameworkchatbotmulti-platform

More Application Frameworks packages