Skip to main content

Overview

The NapCat core configuration file (napcat.json) controls fundamental bot behavior including logging, time synchronization, and security bypass options.

Configuration File Location

The configuration file should be placed in your NapCat config directory:
config/napcat.json

Configuration Schema

Logging Options

fileLog
boolean
default:false
Enable file-based logging. When enabled, logs will be written to files in the logs directory.
consoleLog
boolean
default:true
Enable console logging. Outputs log messages to the console/terminal.
fileLogLevel
string
default:"debug"
Set the log level for file output. Available levels: debug, info, warn, error.
consoleLogLevel
string
default:"info"
Set the log level for console output. Available levels: debug, info, warn, error.

Packet Backend Settings

packetBackend
string
default:"auto"
Specify the packet backend to use. Set to auto for automatic selection, or specify a custom backend.
packetServer
string
default:""
URL of the packet server. Leave empty to use default settings.

Advanced Options

o3HookMode
number
default:0
O3 hook mode configuration. Controls how NapCat hooks into NTQQ’s message handling.
  • 0: Default mode
  • Other values: Advanced hook modes (use with caution)
autoTimeSync
boolean
default:true
Automatically synchronize time with the server. Helps prevent authentication issues due to clock drift.

Security Bypass Options

bypass
object
Configure which security checks to bypass. This is an advanced feature that should be used carefully.

Configuration Examples

{
  "fileLog": true,
  "consoleLog": true,
  "fileLogLevel": "info",
  "consoleLogLevel": "info",
  "autoTimeSync": true
}

Notes

  • All configuration fields are optional and will use their default values if not specified
  • The configuration is validated using JSON5 format, so you can include comments
  • Changes to most settings require a restart of NapCat to take effect
  • Debug log levels can generate large log files quickly; use them sparingly in production

Build docs developers (and LLMs) love