fix: 默认启用NapCat反检测配置

This commit is contained in:
sunlei 2026-06-29 12:26:28 +08:00
parent e356784836
commit 8d96e3dc48
2 changed files with 20 additions and 12 deletions

View File

@ -29,12 +29,12 @@ type OnebotConfig = {
type NapcatConfig = {
bypass: {
container: false;
hook: false;
js: false;
module: false;
process: false;
window: false;
container: true;
hook: true;
js: true;
module: true;
process: true;
window: true;
};
o3HookMode: 0;
packetBackend: 'auto';
@ -68,12 +68,12 @@ export class NapcatConfigWriterService {
};
const napcatConfig: NapcatConfig = {
bypass: {
container: false,
hook: false,
js: false,
module: false,
process: false,
window: false,
container: true,
hook: true,
js: true,
module: true,
process: true,
window: true,
},
o3HookMode: 0,
packetBackend: 'auto',

View File

@ -253,6 +253,14 @@ describe('NapCat runtime profile generation', () => {
reconnectInterval: 5000,
reportSelfMessage: false,
});
expect(result.napcatConfig.bypass).toEqual({
container: true,
hook: true,
js: true,
module: true,
process: true,
window: true,
});
expect(result.napcatConfig.o3HookMode).toBe(0);
expect(
result.files.find((file) => file.path === 'webui.json')?.content,