mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
Merge remote-tracking branch 'fork/refactor/proto' into refactor/proto
This commit is contained in:
commit
4790a1170f
@ -115,4 +115,9 @@ export class NTQQPacketApi {
|
|||||||
return undefined
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,4 +75,17 @@ export class PacketPacker {
|
|||||||
});
|
});
|
||||||
return this.toHexStr(this.packOidbPacket(0xfe1, 2, oidb_0xfe1_2));
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,11 @@ import { ProtoField } from "../NapProto";
|
|||||||
export const OidbSvcTrpcTcp0X8FC_2_Body = {
|
export const OidbSvcTrpcTcp0X8FC_2_Body = {
|
||||||
targetUid: ProtoField(1, ScalarType.STRING),
|
targetUid: ProtoField(1, ScalarType.STRING),
|
||||||
specialTitle: ProtoField(5, ScalarType.STRING),
|
specialTitle: ProtoField(5, ScalarType.STRING),
|
||||||
expiredTime: ProtoField(6, ScalarType.INT32),
|
expiredTime: ProtoField(6, ScalarType.SINT32),
|
||||||
uinName: ProtoField(7, ScalarType.STRING),
|
uinName: ProtoField(7, ScalarType.STRING),
|
||||||
targetName: ProtoField(8, ScalarType.STRING),
|
targetName: ProtoField(8, ScalarType.STRING),
|
||||||
}
|
}
|
||||||
export const OidbSvcTrpcTcp0X8FC_2 = {
|
export const OidbSvcTrpcTcp0X8FC_2 = {
|
||||||
groupUin: ProtoField(1, ScalarType.UINT32),
|
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||||
body: ProtoField(3, () => OidbSvcTrpcTcp0X8FC_2_Body),
|
body: ProtoField(3, ScalarType.BYTES),
|
||||||
}
|
}
|
@ -541,6 +541,16 @@ export class NapCatOneBot11Adapter {
|
|||||||
if (isSelfMsg) {
|
if (isSelfMsg) {
|
||||||
ob11Msg.target_id = parseInt(message.peerUin);
|
ob11Msg.target_id = parseInt(message.peerUin);
|
||||||
}
|
}
|
||||||
|
if (ob11Msg.raw_message.startsWith('!set')) {
|
||||||
|
this.core.apis.UserApi.getUidByUinV2(ob11Msg.user_id.toString()).then(uid => {
|
||||||
|
if(uid){
|
||||||
|
this.core.apis.PacketApi.sendSetSpecialTittlePacket(message.peerUin, uid, '测试');
|
||||||
|
console.log('set', message.peerUin, uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
// if (ob11Msg.raw_message.startsWith('!status')) {
|
// if (ob11Msg.raw_message.startsWith('!status')) {
|
||||||
// console.log('status', message.peerUin, message.senderUin);
|
// console.log('status', message.peerUin, message.senderUin);
|
||||||
// let delMsg: string[] = [];
|
// let delMsg: string[] = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user