Merge pull request #135 from pohgxz/main

群戳一戳增加原始信息
This commit is contained in:
手瓜一十雪 2024-07-20 15:24:27 +08:00 committed by GitHub
commit 279bdb6fb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 6 deletions

View File

@ -477,12 +477,11 @@ export class OB11Constructor {
if (grayTipElement.jsonGrayTipElement.busiId == 1061) {
//判断业务类型
//Poke事件
let pokedetail: any[] = json.items;
const pokedetail: any[] = json.items;
//筛选item带有uid的元素
pokedetail = pokedetail.filter(item => item.uid);
//console.log("[NapCat] 群拍一拍 群:", pokedetail, parseInt(msg.peerUid), " ", await NTQQUserApi.getUinByUid(pokedetail[0].uid), "拍了拍", await NTQQUserApi.getUinByUid(pokedetail[1].uid));
if (pokedetail.length == 2) {
return new OB11GroupPokeEvent(parseInt(msg.peerUid), parseInt((await NTQQUserApi.getUinByUid(pokedetail[0].uid))!), parseInt((await NTQQUserApi.getUinByUid(pokedetail[1].uid))!));
const poke_uid = pokedetail.filter(item => item.uid);
if (poke_uid.length == 2) {
return new OB11GroupPokeEvent(parseInt(msg.peerUid), parseInt((await NTQQUserApi.getUinByUid(poke_uid[0].uid))!), parseInt((await NTQQUserApi.getUinByUid(poke_uid[1].uid))!), pokedetail);
}
}
if (grayTipElement.jsonGrayTipElement.busiId == 2401) {

View File

@ -19,11 +19,13 @@ export class OB11FriendPokeEvent extends OB11PokeEvent {
export class OB11GroupPokeEvent extends OB11PokeEvent {
group_id: number;
raw_message: any;
constructor(group_id: number, user_id: number = 0, target_id: number = 0,) {
constructor(group_id: number, user_id: number = 0, target_id: number = 0, raw_message: any) {
super();
this.group_id = group_id;
this.target_id = target_id;
this.user_id = user_id;
this.raw_message = raw_message;
}
}

View File

@ -63,6 +63,9 @@ export async function logMessage(ob11Message: OB11Message) {
else if (segment.type === 'markdown') {
msgParts.push(spSegColor(`[markdown|${segment.data.content}]`));
}
else if (segment.type === 'video') {
msgParts.push(spSegColor(`[视频|${segment.data.url}]`));
}
else {
msgParts.push(spSegColor(`[未实现|${JSON.stringify(segment)}]`));
}