mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
release: v1.5.9
This commit is contained in:
parent
68b9771fa9
commit
ae4b4e7ff9
@ -4,6 +4,7 @@ QQ Version: Windows 9.9.11-24815 / Linux 3.2.9-24815
|
|||||||
|
|
||||||
## 修复与优化
|
## 修复与优化
|
||||||
* 优化缓存问题
|
* 优化缓存问题
|
||||||
|
* 修复poke异常上报
|
||||||
|
|
||||||
## 新增与调整
|
## 新增与调整
|
||||||
|
|
@ -114,10 +114,11 @@ export class NapCatOnebot11 {
|
|||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
try {
|
try {
|
||||||
// 生产环境会自己去掉
|
let hex = buf2hex(Buffer.from(protobufData));
|
||||||
if (import.meta.env.MODE == 'development') {
|
// if (import.meta.env.MODE == 'development') {
|
||||||
logDebug(buf2hex(Buffer.from(protobufData)));
|
// logDebug(buf2hex(Buffer.from(protobufData)));
|
||||||
}
|
// }
|
||||||
|
console.log(hex);
|
||||||
const sysMsg = SysData.fromBinary(Buffer.from(protobufData));
|
const sysMsg = SysData.fromBinary(Buffer.from(protobufData));
|
||||||
const peeruin = sysMsg.header[0].peerNumber;
|
const peeruin = sysMsg.header[0].peerNumber;
|
||||||
const peeruid = sysMsg.header[0].peerString;
|
const peeruid = sysMsg.header[0].peerString;
|
||||||
@ -127,25 +128,31 @@ export class NapCatOnebot11 {
|
|||||||
let pokeEvent: OB11FriendPokeEvent | OB11GroupPokeEvent;
|
let pokeEvent: OB11FriendPokeEvent | OB11GroupPokeEvent;
|
||||||
//console.log(peeruid);
|
//console.log(peeruid);
|
||||||
if (MsgType == 528 && subType0 == 290) {
|
if (MsgType == 528 && subType0 == 290) {
|
||||||
// 防止上报两次 私聊戳一戳
|
// 这里不知道怎么也会有奇怪的信息乱来 04结尾就是没有content
|
||||||
if (PokeCache.has(peeruid)) {
|
if (hex.length < 250 && hex.endsWith('04')) {
|
||||||
PokeCache.delete(peeruid);
|
if (!PokeCache.has(peeruid)) {
|
||||||
} else {
|
log('[私聊] 用户 ', peeruin, ' 对你戳一戳');
|
||||||
|
pokeEvent = new OB11FriendPokeEvent(peeruin);
|
||||||
|
postOB11Event(pokeEvent);
|
||||||
|
}
|
||||||
PokeCache.set(peeruid, false);
|
PokeCache.set(peeruid, false);
|
||||||
log('[私聊] 用户 ', peeruin, ' 对你戳一戳');
|
setTimeout(() => {
|
||||||
pokeEvent = new OB11FriendPokeEvent(peeruin);
|
PokeCache.delete(peeruid)
|
||||||
postOB11Event(pokeEvent);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MsgType == 732 && subType0 == 20) {
|
if (MsgType == 732 && subType0 == 20) {
|
||||||
// 防止上报两次 群聊戳一戳
|
// GroupCommonTip 由于GroupPoke没有关键内容 所以混在一起 小包且无内容为poke
|
||||||
if (PokeCache.has(peeruid)) {
|
if (hex.length < 150 && hex.endsWith('04')) {
|
||||||
PokeCache.delete(peeruid);
|
if (PokeCache.has(peeruid)) {
|
||||||
} else {
|
log('[群聊] 群组 ', peeruin, ' 戳一戳');
|
||||||
|
pokeEvent = new OB11GroupPokeEvent(peeruin);
|
||||||
|
postOB11Event(pokeEvent);
|
||||||
|
}
|
||||||
PokeCache.set(peeruid, false);
|
PokeCache.set(peeruid, false);
|
||||||
log('[群聊] 群组 ', peeruin, ' 戳一戳');
|
setTimeout(() => {
|
||||||
pokeEvent = new OB11GroupPokeEvent(peeruin);
|
PokeCache.delete(peeruid)
|
||||||
postOB11Event(pokeEvent);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MsgType == 528 && subType0 == 349) {
|
if (MsgType == 528 && subType0 == 349) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user