parent
6255af3619
commit
cfbb683564
@ -8,6 +8,7 @@ class LarkBody {
|
|||||||
public isMessageEvent?: boolean
|
public isMessageEvent?: boolean
|
||||||
public msgType?: LarkEvent.Message["message_type"]
|
public msgType?: LarkEvent.Message["message_type"]
|
||||||
public userId?: LarkEvent.UserIdInfo["user_id"]
|
public userId?: LarkEvent.UserIdInfo["user_id"]
|
||||||
|
public openId?: LarkEvent.UserIdInfo["open_id"]
|
||||||
public msgText: string = ""
|
public msgText: string = ""
|
||||||
public rawMsgText: string = ""
|
public rawMsgText: string = ""
|
||||||
public chatType?: LarkEvent.Message["chat_type"]
|
public chatType?: LarkEvent.Message["chat_type"]
|
||||||
@ -39,6 +40,7 @@ class LarkBody {
|
|||||||
this.isMessageEvent = this.getIsMessageEvent(eventBody)
|
this.isMessageEvent = this.getIsMessageEvent(eventBody)
|
||||||
this.msgType = this.getMsgType(eventBody)
|
this.msgType = this.getMsgType(eventBody)
|
||||||
this.userId = this.getUserId(eventBody)
|
this.userId = this.getUserId(eventBody)
|
||||||
|
this.openId = this.getOpenId(eventBody)
|
||||||
this.msgText = this.getMsgText(eventBody)
|
this.msgText = this.getMsgText(eventBody)
|
||||||
this.rawMsgText = this.getRawMsgText(eventBody)
|
this.rawMsgText = this.getRawMsgText(eventBody)
|
||||||
this.chatType = this.getChatType(eventBody)
|
this.chatType = this.getChatType(eventBody)
|
||||||
@ -112,6 +114,15 @@ class LarkBody {
|
|||||||
return body?.event?.sender?.sender_id?.user_id
|
return body?.event?.sender?.sender_id?.user_id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户OpenId
|
||||||
|
* @param body 事件消息体
|
||||||
|
* @returns 用户OpenId
|
||||||
|
*/
|
||||||
|
private getOpenId(body: LarkEvent.Data) {
|
||||||
|
return body?.event?.sender?.sender_id?.open_id
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文本内容并剔除艾特信息
|
* 获取文本内容并剔除艾特信息
|
||||||
* @param body 事件消息体
|
* @param body 事件消息体
|
||||||
|
Loading…
x
Reference in New Issue
Block a user