mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 21:10:23 +00:00
feat: uin转换优化&poke支持重写
This commit is contained in:
@@ -124,30 +124,30 @@ export class NapCatOnebot11 {
|
||||
const subType1 = sysMsg.body[0].subType1;
|
||||
let pokeEvent: OB11FriendPokeEvent | OB11GroupPokeEvent;
|
||||
//console.log(peeruid);
|
||||
if (MsgType == 528 && subType0 == 290 && hex.length < 250 && hex.endsWith('04')) {
|
||||
// 防止上报两次 私聊戳一戳
|
||||
if (PokeCache.has(peeruid)) {
|
||||
log('[私聊] 用户 ', peeruin, ' 对你戳一戳');
|
||||
pokeEvent = new OB11FriendPokeEvent(peeruin);
|
||||
postOB11Event(pokeEvent);
|
||||
}
|
||||
PokeCache.set(peeruid, false);
|
||||
setTimeout(() => {
|
||||
PokeCache.delete(peeruid);
|
||||
}, 1000);
|
||||
}
|
||||
if (MsgType == 732 && subType0 == 20 && hex.length < 150 && hex.endsWith('04')) {
|
||||
// 防止上报两次 群聊戳一戳
|
||||
if (PokeCache.has(peeruid)) {
|
||||
log('[群聊] 群组 ', peeruin, ' 戳一戳');
|
||||
pokeEvent = new OB11GroupPokeEvent(peeruin);
|
||||
postOB11Event(pokeEvent);
|
||||
}
|
||||
PokeCache.set(peeruid, false);
|
||||
setTimeout(() => {
|
||||
PokeCache.delete(peeruid);
|
||||
}, 1000);
|
||||
}
|
||||
// if (MsgType == 528 && subType0 == 290 && hex.length < 250 && hex.endsWith('04')) {
|
||||
// // 防止上报两次 私聊戳一戳
|
||||
// if (PokeCache.has(peeruid)) {
|
||||
// log('[私聊] 用户 ', peeruin, ' 对你戳一戳');
|
||||
// pokeEvent = new OB11FriendPokeEvent(peeruin);
|
||||
// postOB11Event(pokeEvent);
|
||||
// }
|
||||
// PokeCache.set(peeruid, false);
|
||||
// setTimeout(() => {
|
||||
// PokeCache.delete(peeruid);
|
||||
// }, 1000);
|
||||
// }
|
||||
// if (MsgType == 732 && subType0 == 20 && hex.length < 150 && hex.endsWith('04')) {
|
||||
// // 防止上报两次 群聊戳一戳
|
||||
// if (PokeCache.has(peeruid)) {
|
||||
// log('[群聊] 群组 ', peeruin, ' 戳一戳');
|
||||
// pokeEvent = new OB11GroupPokeEvent(peeruin);
|
||||
// postOB11Event(pokeEvent);
|
||||
// }
|
||||
// PokeCache.set(peeruid, false);
|
||||
// setTimeout(() => {
|
||||
// PokeCache.delete(peeruid);
|
||||
// }, 1000);
|
||||
// }
|
||||
if (MsgType == 528 && subType0 == 349) {
|
||||
const sysDeviceMsg = DeviceData.fromBinary(Buffer.from(protobufData));
|
||||
DeviceList = [];
|
||||
@@ -332,6 +332,7 @@ export class NapCatOnebot11 {
|
||||
postOB11Event(msg);
|
||||
// log("post msg", msg)
|
||||
}).catch(e => logError('constructMessage error: ', e));
|
||||
await OB11Constructor.GroupEvent(message);
|
||||
OB11Constructor.GroupEvent(message).then(groupEvent => {
|
||||
if (groupEvent) {
|
||||
// log("post group event", groupEvent);
|
||||
|
||||
Reference in New Issue
Block a user