feat(onebot): set profile gender and return stranger online status

set_qq_profile accepts sex. get_stranger_info now returns the online
status, extended status, and custom status that QQ already provides
on the user profile.

Closes #397
Closes #398
This commit is contained in:
DrSmoothl committed 2026-08-19 21:46:03 +08:00
1 parent 8fdd41ea22
commit d8521d4345
11 files changed
+81 -13

No files matched your search

@@ -21,6 +21,14 @@ describe('SetProfile namespace', () => {
});
describe('invoke', () => {
it('packages sex into integer field 20009', async () => {
const deps = makeDeps();
await SetProfile.invoke(deps, { sex: 1 });
const [, bytes] = deps.sendRawPacket.mock.calls[0]!;
const env = protobuf_decode<OidbBase<OidbSetProfile>>(bytes);
expect(env.body?.intProfiles).toEqual([{ fieldId: 20009, value: 1n }]);
});
it('is a no-op when both nickname and personalNote are undefined', async () => {
const deps = makeDeps();
await SetProfile.invoke(deps, {});