Compare commits
2 Commits
@egg/lark-
...
@egg/lark-
Author | SHA1 | Date | |
---|---|---|---|
25bf67c33a | |||
aca14af0a4 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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",
|
||||
|
@ -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