Introduction
Recently, I found that the WebUI of NapCatQQ has been improved, making it quite suitable for beginners, so I wrote this article.
This article only covers basic usage methods and may lack some advanced features. However, it also requires understanding the following basics: command line, HTTP protocol, Docker, and Python - it's not completely beginner-friendly. (If you only want to use Webhook for notifications or use existing NoneBot plugins, Python programming is not required.)
The tools used are NapCatQQ and NoneBot. The former runs QQ and connects to protocols like OneBot11, while the latter is a framework based on Python for calling protocols. You can check the official documentation when encountering problems. (If you only want to use Webhook for notifications, setting up NapCatQQ is sufficient.)
Preparation
- A server, either internal or external network.
- A QQ account to use as the QQ bot. Using your main account is not recommended.
QQ can detect whether plugins are being used, and your account may encounter the following issues: forced logout, login restrictions, or freezing. Please evaluate your own situation and decide whether to continue. The author is not responsible for any consequences of building a bot following this article.
NapCatQQ
Installation
There are many ways to install NapCatQQ, but since it's a service, I recommend using Docker to install the Shell version: https://napneko.github.io/guide/boot/Shell#napcat-docker-linux-containerized-deployment The Docker container comes with NTQQ itself, so you don't need to install the corresponding version of QQ separately.
At this point, you can visit http://[IP]:6099/webui to see the NTQQ web page for login and settings. The login password can be found in the log file (default: napcat), and it's recommended to change it after logging in.
Alternatively, you can use docker logs napcat to view the logs and scan the QR code to log in to QQ.
When scanning to log in, it's recommended to check the option to skip mobile verification in the future.
Enable HTTP Protocol
In the WebUI, find Network Configuration -> New -> HTTP Server. The name, host, and port can be arbitrary. For message format, Array is recommended, but actual testing shows it's compatible with String, and it can send mixed text-image messages. It's strongly recommended to fill in a Token to prevent malicious requests.
After enabling, you can test in API Debug -> HTTP or any other API testing tool you're comfortable with. API reference: https://napcat.apifox.cn/
There are two ways to use the Token:
- Add
Authorization: [Token]in the request header.
- Add
?access_token=[Token]in the URL.
Using Webhook for Notifications
The most important interfaces here are naturally sending private messages and group messages. You can find the corresponding APIs in API Debug -> HTTP, which also has a message construction feature - it's quite simple.
Here's an example of sending a private message:

Some applications use shoutrrr as a Webhook implementation. You can refer to the following configuration:
Some applications may already support the OneBot11 protocol. In this case, just enter http://[IP]:3000, the Token, and the target QQ number.
nginx Reverse Proxy
If you have a domain name, you can refer to the following nginx configuration example for NapCatQQ:
NoneBot
The documentation is already quite comprehensive, so I won't go into detail here.