fix(onebot): restore group and doubt request accounts
get_group_system_msg now keeps join and invite records, reports the inviter, and fills a missing requester nick from the user profile. get_doubt_friends_add_request returns the QQ number plus the request message, source, and time that QQ actually sends. Closes #400 Closes #401 Closes #402 Closes #403
This commit is contained in:
13 files changed
+418
-79
No files matched your search
@@ -10,7 +10,10 @@ function makeSender(): { sendRawPacket: ReturnType<typeof vi.fn> } {
|
||||
const respEnv: OidbBase<OidbDoubtGetResp> = {
|
||||
command: 0xD69, subCommand: 0,
|
||||
body: { status: 1, body: { list: [
|
||||
{ uid: 'u_alice', nick: 'Alice', source: '可能认识', msg: 'hi', reqTime: 1700000000n },
|
||||
{
|
||||
uid: 'u_alice', nick: 'Alice', source: '可能认识', reason: '',
|
||||
msg: 'hi', uin: 12345n, groupCode: '', reqTime: 1700000000n,
|
||||
},
|
||||
], reason: '' } },
|
||||
};
|
||||
const r: SendPacketResult = {
|
||||
@@ -46,7 +49,10 @@ describe('GetDoubtBuddyReq namespace', () => {
|
||||
it('deserializes the item list to the OneBot shape (uid + reqTime high-confidence)', async () => {
|
||||
const list = await GetDoubtBuddyReq.invoke(makeSender(), { count: 10 });
|
||||
expect(list).toEqual([
|
||||
{ uid: 'u_alice', nick: 'Alice', source: '可能认识', msg: 'hi', reqTime: 1700000000 },
|
||||
{
|
||||
uid: 'u_alice', user_id: 12345, nick: 'Alice', source: '可能认识',
|
||||
reason: '', msg: 'hi', group_code: '', reqTime: 1700000000,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user