chore(lark-msg): 优化代码格式
All checks were successful
/ release (push) Successful in 26s

This commit is contained in:
zhaoyingbo 2024-10-12 03:32:11 +00:00
parent 5d04b76225
commit aca14af0a4

View File

@ -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 ""