Introduction
NapCat Core APIs provide a comprehensive interface to interact with NTQQ services. These APIs are accessed throughNapCatCore.apis and wrap the underlying StableNTApiWrapper interface.
API Structure
All Core APIs follow a consistent structure:- Each API class receives
InstanceContextandNapCatCorein its constructor - Methods are async and return Promises
- APIs interact with NTQQ services through the context session
Available APIs
NapCat Core includes the following API modules:Message API
Send, receive, and manage QQ messages
Group API
Manage groups, members, and group settings
Friend API
Handle friend lists and friend requests
User API
Get user information and profiles
File API
Upload, download, and manage files
System API
System utilities and helper functions
Core Concepts
Peer Object
Many APIs use aPeer object to identify chat targets:
Event Wrapper
APIs useeventWrapper.callNormalEventV2 for event-driven operations:
Basic Usage
Error Handling
All API methods may throw errors. Always wrap calls in try-catch:TypeScript Support
All APIs are fully typed with TypeScript interfaces. Import types from@/napcat-core/types:
