Skip to main content

Introduction

NapCat Core APIs provide a comprehensive interface to interact with NTQQ services. These APIs are accessed through NapCatCore.apis and wrap the underlying StableNTApiWrapper interface.

API Structure

All Core APIs follow a consistent structure:
  • Each API class receives InstanceContext and NapCatCore in 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 a Peer object to identify chat targets:

Event Wrapper

APIs use eventWrapper.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: