This commit is contained in:
parent
5d04b76225
commit
aca14af0a4
@ -67,7 +67,7 @@ class LarkBody {
|
||||
* @param body 事件消息体
|
||||
* @returns 事件文本类型
|
||||
*/
|
||||
private getMsgType(body: LarkEvent.Data): string | undefined {
|
||||
private getMsgType(body: LarkEvent.Data) {
|
||||
return body?.event?.message?.message_type
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ class LarkBody {
|
||||
* @param body 事件消息体
|
||||
* @returns 用户Id
|
||||
*/
|
||||
private getUserId(body: LarkEvent.Data): string | undefined {
|
||||
private getUserId(body: LarkEvent.Data) {
|
||||
return body?.event?.sender?.sender_id?.user_id
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class LarkBody {
|
||||
* @param body 事件消息体
|
||||
* @returns 文本内容
|
||||
*/
|
||||
private getMsgText(body: LarkEvent.Data): string {
|
||||
private getMsgText(body: LarkEvent.Data) {
|
||||
try {
|
||||
const { text }: { text: string } = JSON.parse(
|
||||
body?.event?.message?.content
|
||||
@ -103,7 +103,7 @@ class LarkBody {
|
||||
* @param body 事件消息体
|
||||
* @returns 聊天类型
|
||||
*/
|
||||
private getChatType(body: LarkEvent.Data): string | undefined {
|
||||
private getChatType(body: LarkEvent.Data) {
|
||||
return body?.event?.message?.chat_type
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ class LarkBody {
|
||||
* @param body 事件消息体
|
||||
* @returns 艾特信息
|
||||
*/
|
||||
private getMentions(body: LarkEvent.Data): any {
|
||||
private getMentions(body: LarkEvent.Data) {
|
||||
return body?.event?.message?.mentions
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ class LarkBody {
|
||||
* @param body Action消息体
|
||||
* @returns Action类型
|
||||
*/
|
||||
private getActionType(body: LarkAction.Data): string | undefined {
|
||||
private getActionType(body: LarkAction.Data) {
|
||||
return body?.action?.tag
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ class LarkBody {
|
||||
* @param body Action消息体
|
||||
* @returns Action参数
|
||||
*/
|
||||
private getActionValue(body: LarkAction.Data): any {
|
||||
private getActionValue(body: LarkAction.Data) {
|
||||
return body?.action?.value
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ class LarkBody {
|
||||
* @param body Action消息体
|
||||
* @returns Action选项
|
||||
*/
|
||||
private getActionOption(body: LarkAction.Data): any {
|
||||
private getActionOption(body: LarkAction.Data) {
|
||||
return body?.action?.option
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ class LarkBody {
|
||||
* @param body 事件消息体或Action消息体
|
||||
* @returns 对话流Id
|
||||
*/
|
||||
private getChatId(body: LarkEvent.Data | LarkAction.Data): string {
|
||||
private getChatId(body: LarkEvent.Data | LarkAction.Data) {
|
||||
if (this.getIsEventMsg(body)) return body?.event?.message?.chat_id
|
||||
if (this.getIsActionMsg(body)) return body?.open_chat_id
|
||||
return ""
|
||||
@ -159,7 +159,7 @@ class LarkBody {
|
||||
* @param body 事件消息体或Action消息体
|
||||
* @returns 消息Id
|
||||
*/
|
||||
private getMessageId(body: LarkEvent.Data | LarkAction.Data): string {
|
||||
private getMessageId(body: LarkEvent.Data | LarkAction.Data) {
|
||||
if (this.getIsEventMsg(body)) return body?.event?.message?.message_id
|
||||
if (this.getIsActionMsg(body)) return body?.open_message_id
|
||||
return ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user