Foreword
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 and may lack some advanced features. However, you also need to understand the following basics: command line, HTTP protocol, Docker, Python; it's not completely zero-basis. (If you only want to use Webhook for notifications or use existing NoneBot plugins, you don't need Python programming.)
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 that calls the protocol. You can refer to the official documentation when encountering problems. (If you only want to use Webhook for notifications, you can stop after setting up NapCatQQ.)
Preparation
- A server, whether internal or external network.
- A QQ account to serve as the QQ bot; it is not recommended to use your main account.
QQ can detect whether a plugin is used, and your account may encounter the following issues: forced logout, login restrictions, freezing.
Please evaluate and decide whether to continue based on your own situation. The author is not responsible for any consequences of building a bot by following this article.
NapCatQQ
Installation
There are many ways to install NapCatQQ, but since it's a service, I still recommend using Docker to install the Shell version: https://napneko.github.io/guide/boot/Shell#napcat-docker-linux容器化部署
The Docker container comes with the NTQQ itself, so you don't need to install the corresponding version of QQ separately.
At this point, visit http://[IP]:6099/webui to see the NTQQ web page, where you can log in and configure settings. The login password can be found in the log file (default: napcat); it is 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 the QR code to log in, it is recommended to check the option for no further phone verification.
Enable HTTP Protocol
In the WebUI, go to Network Configuration -> New -> HTTP Server. The name, Host, and port can be arbitrary. For the message format, it is recommended to choose Array. In practice, it is compatible with String and can send mixed text and image messages. It is strongly recommended to fill in a Token to prevent malicious requests.
After enabling, you can test it in Interface Debugging -> HTTP or with any API testing tool you are comfortable with. The API reference can be found at: 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 sending group messages. You can find the corresponding API in Interface Debugging -> HTTP, which also has a message construction feature; it's quite simple.
Here is an example of sending a private message:

Some applications use shoutrrr as the Webhook implementation, and you can refer to the following configuration:
Some applications may already support the OneBot11 protocol; in that case, simply fill in 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 very comprehensive, so I won't elaborate further here.