Compare commits

...

2 Commits

Author SHA1 Message Date
25bf67c33a chore(release): publish
- @egg/lark-msg-tool@1.6.3
2024-10-12 03:32:36 +00:00
aca14af0a4 chore(lark-msg): 优化代码格式
All checks were successful
/ release (push) Successful in 26s
2024-10-12 03:32:11 +00:00
4 changed files with 16 additions and 12 deletions

2
package-lock.json generated
View File

@ -12122,7 +12122,7 @@
},
"packages/lark-msg-tool": {
"name": "@egg/lark-msg-tool",
"version": "1.6.2",
"version": "1.6.3",
"license": "ISC",
"dependencies": {
"@egg/logger": "^1.4.3",

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.6.3](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.6.2...@egg/lark-msg-tool@1.6.3) (2024-10-12)
**Note:** Version bump only for package @egg/lark-msg-tool
## [1.6.2](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.6.1...@egg/lark-msg-tool@1.6.2) (2024-10-12)
**Note:** Version bump only for package @egg/lark-msg-tool

View File

@ -1,6 +1,6 @@
{
"name": "@egg/lark-msg-tool",
"version": "1.6.2",
"version": "1.6.3",
"description": "Lark Msg Tools for Egg projects",
"type": "module",
"main": "src/index.ts",

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