mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
修改poke事件
新增poke事件支持上传raw信息
This commit is contained in:
parent
aa8739d016
commit
5fa2427c51
@ -321,11 +321,11 @@ export class OB11Constructor {
|
|||||||
if (element.grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
if (element.grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
||||||
//判断业务类型
|
//判断业务类型
|
||||||
//Poke事件
|
//Poke事件
|
||||||
let pokedetail: any[] = json.items;
|
const pokedetail: any[] = json.items;
|
||||||
//筛选item带有uid的元素
|
//筛选item带有uid的元素
|
||||||
pokedetail = pokedetail.filter(item => item.uid);
|
const poke_uid = pokedetail.filter(item => item.uid);
|
||||||
if (pokedetail.length == 2) {
|
if (poke_uid.length == 2) {
|
||||||
return new OB11FriendPokeEvent(parseInt((uidMaps[pokedetail[0].uid])!), parseInt((uidMaps[pokedetail[1].uid])));
|
return new OB11FriendPokeEvent(parseInt((uidMaps[poke_uid[0].uid])!), parseInt((uidMaps[poke_uid[1].uid])), pokedetail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//下面得改 上面也是错的grayTipElement.subElementType == GrayTipElementSubType.MEMBER_NEW_TITLE
|
//下面得改 上面也是错的grayTipElement.subElementType == GrayTipElementSubType.MEMBER_NEW_TITLE
|
||||||
@ -526,11 +526,11 @@ export class OB11Constructor {
|
|||||||
if (grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
if (grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
||||||
//判断业务类型
|
//判断业务类型
|
||||||
//Poke事件
|
//Poke事件
|
||||||
let pokedetail: any[] = json.items;
|
const pokedetail: any[] = json.items;
|
||||||
//筛选item带有uid的元素
|
//筛选item带有uid的元素
|
||||||
pokedetail = pokedetail.filter(item => item.uid);
|
const poke_uid = pokedetail.filter(item => item.uid);
|
||||||
if (pokedetail.length == 2) {
|
if (poke_uid.length == 2) {
|
||||||
return new OB11GroupPokeEvent(parseInt(msg.peerUid), parseInt((uidMaps[pokedetail[0].uid])!), parseInt((uidMaps[pokedetail[1].uid])));
|
return new OB11GroupPokeEvent(parseInt(msg.peerUid), parseInt((uidMaps[poke_uid[0].uid])!), parseInt((uidMaps[poke_uid[1].uid])), pokedetail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const memberUin = json.items[1].param[0]
|
const memberUin = json.items[1].param[0]
|
||||||
|
@ -5,25 +5,27 @@ import { OB11BaseEvent } from '../OB11BaseEvent'
|
|||||||
class OB11PokeEvent extends OB11BaseNoticeEvent {
|
class OB11PokeEvent extends OB11BaseNoticeEvent {
|
||||||
notice_type = 'notify'
|
notice_type = 'notify'
|
||||||
sub_type = 'poke'
|
sub_type = 'poke'
|
||||||
target_id = parseInt(selfInfo.uin)
|
target_id = 0
|
||||||
user_id: number
|
user_id: number
|
||||||
|
raw_message: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OB11FriendPokeEvent extends OB11PokeEvent {
|
export class OB11FriendPokeEvent extends OB11PokeEvent {
|
||||||
constructor(user_id: number, target_id: number) {
|
constructor(user_id: number, target_id: number, raw_message: any) {
|
||||||
super();
|
super();
|
||||||
this.target_id = target_id;
|
this.target_id = target_id;
|
||||||
this.user_id = user_id;
|
this.user_id = user_id;
|
||||||
|
this.raw_message = raw_message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OB11GroupPokeEvent extends OB11PokeEvent {
|
export class OB11GroupPokeEvent extends OB11PokeEvent {
|
||||||
group_id: number
|
group_id: number
|
||||||
|
constructor(group_id: number, user_id: number = 0, target_id: number = 0, raw_message: any) {
|
||||||
constructor(group_id: number, user_id: number = 0, target_id: number = 0) {
|
|
||||||
super()
|
super()
|
||||||
this.group_id = group_id
|
this.group_id = group_id
|
||||||
this.target_id = target_id
|
this.target_id = target_id
|
||||||
this.user_id = user_id
|
this.user_id = user_id
|
||||||
|
this.raw_message = raw_message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user