Lingchu Bot documentation is now live — check it out!
Lingchu Bot

Quick Start

Quick Start

Lingchu Bot quick start runtime setup

This page explains how to prepare Lingchu Bot locally. Before connecting to a real platform, prepare the account, network, and configuration required by NoneBot and the enabled adapter. The QQ platform enables OneBot V11 by default. Milky, QQ, and OneBot V12 adapters are deprecated and fully removed.

Requirements

  • Python 3.13
  • uv
  • git
  • A runtime environment usable by the enabled QQ adapter; OneBot V11 is the default

Setup steps

Get the code

git clone https://github.com/xinvxueyuan/lingchu-bot.git
cd lingchu-bot

Run the setup script

The project provides a cross-platform setup script that automates the entire initialization process:

chmod +x scripts/setup.sh
./scripts/setup.sh

The script will:

  1. Detect your operating system and required toolchain
  2. Verify Python 3.13+, Node.js 20+, pnpm 9+, Git, and uv
  3. Install all Python and Node.js dependencies
  4. Generate environment configuration files (.env, .env.development, .env.test, .env.production)
  5. Configure Git hooks (husky)
  6. Optionally initialize a Git repository and install Playwright browsers

See ./scripts/setup.sh --help for all available options.

Install dependencies (manual alternative)

If you prefer to install manually instead of using the setup script:

uv sync --frozen
pnpm install
pnpm exec husky
cp .env.example .env

Choose a runtime mode

Load this repository as a local plugin directory from an existing NoneBot project. Make sure the target NoneBot project loads src/plugins:

# In the NoneBot project's pyproject.toml
[tool.nonebot]
plugin_dirs = ["path/to/lingchu-bot/src/plugins"]

The repository provides a Docker build flow. The Docker image generates the runtime /tmp/bot.py with nb-cli during build:

docker compose up --build

Pre-run checklist

  • Confirm that Python is version 3.13.
  • Confirm that the service and connection settings for the enabled adapter are ready.
  • If runtime registers multiple QQ adapters, Lingchu Bot only enables the business code selected by LINGCHUAdapter; make sure the selected adapter has also been loaded by NoneBot.
  • Confirm that the target NoneBot project loads src/plugins, or that you are using the repository Docker runner.
  • Confirm that Boolean values in NoneBot configuration use lowercase true / false, not True / False.

Boolean values

NoneBot configuration files only accept standard JSON lowercase true / false. Using True / False will raise a configuration error at startup.

Next steps

Last updated on

On this page