fix: add test

This commit is contained in:
手瓜一十雪
2024-10-13 19:23:28 +08:00
parent 7bcff34562
commit 6c58a8ac6e
4 changed files with 30 additions and 2 deletions

View File

@@ -115,4 +115,9 @@ export class NTQQPacketApi {
return undefined
}
}
async sendSetSpecialTittlePacket(groupCode: string, uid: string, tittle: string) {
let data = this.packetPacker.packSetSpecialTittlePacket(groupCode, uid, tittle);
let ret = await this.core.apis.PacketApi.sendPacket('OidbSvcTrpcTcp.0x8fc_2', data, true);
console.log('ret: ', ret);
}
}

View File

@@ -75,4 +75,17 @@ export class PacketPacker {
});
return this.toHexStr(this.packOidbPacket(0xfe1, 2, oidb_0xfe1_2));
}
packSetSpecialTittle(groupCode: string, uid: string, tittle: string): PacketHexStr {
const oidb_0x8FC_2_body = new NapProtoMsg(OidbSvcTrpcTcp0X8FC_2_Body).encode({
targetUid: uid,
specialTitle: tittle,
expiredTime: -1,
uinName: tittle
});
const oidb_0x8FC_2 = new NapProtoMsg(OidbSvcTrpcTcp0X8FC_2).encode({
groupUin: +groupCode,
body: oidb_0x8FC_2_body
});
return this.toHexStr(this.packOidbPacket(0x8FC, 2, oidb_0x8FC_2));
}
}

View File

@@ -6,11 +6,11 @@ import { ProtoField } from "../NapProto";
export const OidbSvcTrpcTcp0X8FC_2_Body = {
targetUid: ProtoField(1, ScalarType.STRING),
specialTitle: ProtoField(5, ScalarType.STRING),
expiredTime: ProtoField(6, ScalarType.INT32),
expiredTime: ProtoField(6, ScalarType.SINT32),
uinName: ProtoField(7, ScalarType.STRING),
targetName: ProtoField(8, ScalarType.STRING),
}
export const OidbSvcTrpcTcp0X8FC_2 = {
groupUin: ProtoField(1, ScalarType.UINT32),
body: ProtoField(3, () => OidbSvcTrpcTcp0X8FC_2_Body),
body: ProtoField(3, ScalarType.BYTES),
}