Overview
This quickstart guide will help you set up NapCat and send your first message in about 5-10 minutes. We’ll use Framework Mode which is the easiest way to get started.This guide assumes you have QQ installed on your system. If you don’t have QQ, download it from the official QQ website.
Prerequisites
Before you begin, make sure you have:- QQ installed (Windows/macOS/Linux)
- Node.js 18.0.0 or higher
- A QQ account for your bot
- Basic command line knowledge
Step 1: Download NapCat
Get the latest release
Download the latest version of NapCat from the GitHub Releases page.Choose the appropriate package for your operating system:
- Windows:
NapCat-win-x64.zip - macOS:
NapCat-darwin-x64.zip - Linux:
NapCat-linux-x64.zip
Step 2: Initial Configuration
Create a basic configuration file to get started:Step 3: Launch NapCat
- Windows
- Linux/macOS
Double-click
napcat.exe or run from command prompt:On first launch, NapCat will show you the WebUI URL with a token. Save this URL - you’ll use it to access the management interface.
Step 4: Login to QQ
Open WebUI
Open the WebUI URL shown in the console output (e.g.,
http://127.0.0.1:6099/webui/?token=xxxxx)Choose login method
You have three options:
- QR Code Login (Recommended): Scan QR code with your phone
- Quick Login: Use saved account if you’ve logged in before
- Password Login: Login with account and password
Step 5: Verify Connection
Test that your bot is working by calling the API:cURL
If you see a valid response with your bot’s user ID and nickname, your bot is ready to use!
Step 6: Send Your First Message
Let’s send a test message to yourself or a friend:987654321 with a real QQ number (you can send to yourself first for testing).
Step 7: Receive Messages
To receive messages, you have two options:Option 1: WebSocket (Recommended)
Update yourconfig/onebot11.json to enable WebSocket:
Node.js WebSocket Client
Option 2: HTTP Webhook
Enable webhook inconfig/onebot11.json:
Next Steps
Congratulations! You’ve successfully set up NapCat and sent your first message. Here’s what to explore next:Configuration
Learn about all configuration options
Message Handling
Work with different message types and media
API Reference
Explore all available API actions
Deployment
Deploy your bot to production
Troubleshooting
Port already in use
Port already in use
If port 3000 or 3001 is already in use, change the port number in
config/onebot11.json to an available port (e.g., 3002, 8080).Cannot connect to API
Cannot connect to API
Make sure:
- NapCat is running and shows “HTTP Server started” in the logs
- You’re using the correct host and port
- Firewall allows the connection
Login failed
Login failed
Try these solutions:
- Refresh the QR code if it expired
- Use quick login if you’ve logged in before
- Check if QQ account has restrictions
Message not received
Message not received
Verify:
- The target QQ number is correct
- Your bot account hasn’t been restricted
- The recipient hasn’t blocked your bot
