Add manual IM bot credential access

This commit is contained in:
xmanrui 2026-08-16 01:54:06 +08:00
parent d5d2c18ce0
commit 7123fce47a
42 changed files with 2458 additions and 889 deletions

View file

@ -79,3 +79,25 @@ test('QQ bridge accepts only the scanner and requires an at-message event in gro
assert.equal(asks, 0);
assert.equal(bridge.status.messagesRejected, 1);
});
test('QQ credential-bound bots accept senders within the platform visibility scope', async () => {
let asks = 0;
const bridge = new QqHarnessBridge({
bot: { sendText: async () => {} },
ownerUserOpenid: '*',
harness: {
sessionExists: async () => true,
ask: async () => { asks += 1; return 'ok'; },
},
state: {
hasSeen: () => false,
markSeen: async () => {},
sessionFor: () => 'session',
setSession: async () => {},
clearSession: async () => {},
},
});
await bridge.accept(message({ messageId: 'visible', senderId: 'visible-user' }));
assert.equal(asks, 1);
assert.equal(bridge.status.messagesRejected, 0);
});