From 14b301d3e6ccb221670bdd0bd5602e3c6d1a6d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 17 Jan 2026 18:54:18 +0800 Subject: [PATCH] Pass CLI args to worker and update login script example The quickLoginExample.bat script was updated to use the new launcher script names and argument format. In napcat.ts, the master process now forwards its command line arguments to the worker process, enabling better parameter handling. --- packages/napcat-shell-loader/quickLoginExample.bat | 4 ++-- packages/napcat-shell/napcat.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/napcat-shell-loader/quickLoginExample.bat b/packages/napcat-shell-loader/quickLoginExample.bat index 26cbee3f..95c401a6 100644 --- a/packages/napcat-shell-loader/quickLoginExample.bat +++ b/packages/napcat-shell-loader/quickLoginExample.bat @@ -3,5 +3,5 @@ REM 快速登录示例脚本 REM -q 参数是可选的,不传则使用二维码登录 REM REM 使用方法(删掉对应系统那行的 REM): -REM ./launcher.bat -q 123456 -REM ./launcher-win10.bat -q 123456 +REM ./launcher-user.bat 123456 +REM ./launcher-win10-user.bat 123456 diff --git a/packages/napcat-shell/napcat.ts b/packages/napcat-shell/napcat.ts index 8b4a633c..12de54b8 100644 --- a/packages/napcat-shell/napcat.ts +++ b/packages/napcat-shell/napcat.ts @@ -151,7 +151,8 @@ async function startWorker (): Promise { const workerScript = getWorkerScriptPath(); const processType = getProcessTypeName(); - const child = processManager.createWorker(workerScript, [], { + // 传递 master 进程的命令行参数给 worker 进程 + const child = processManager.createWorker(workerScript, process.argv.slice(2), { env: { ...process.env, NAPCAT_WORKER_PROCESS: '1',