Compare commits

...

2 Commits

Author SHA1 Message Date
6adca178f7 chore(release): publish
- @egg/lark-msg-tool@1.4.0
2024-09-26 02:43:44 +00:00
2043349d92 feat(lark-msg): 支持获取消息Id
All checks were successful
/ release (push) Successful in 57s
2024-09-26 02:42:46 +00:00
4 changed files with 19 additions and 2 deletions

2
package-lock.json generated
View File

@ -12258,7 +12258,7 @@
},
"packages/lark-msg-tool": {
"name": "@egg/lark-msg-tool",
"version": "1.3.1",
"version": "1.4.0",
"license": "ISC"
},
"packages/logger": {

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.4.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.3.1...@egg/lark-msg-tool@1.4.0) (2024-09-26)
### Features
- **lark-msg:** 支持获取消息Id ([2043349](http://yingbo.im:3000/zhaoyingbo/egg_tools/commits/2043349d92f80bb1a1d9ab29cbb1061aa655b99d))
## [1.3.1](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.3.0...@egg/lark-msg-tool@1.3.1) (2024-09-26)
**Note:** Version bump only for package @egg/lark-msg-tool

View File

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

View File

@ -108,4 +108,15 @@ export const getChatId = (body: LarkEvent.Data | LarkAction.Data) => {
return ""
}
/**
* Id
* @param body
* @returns Id
*/
export const getMessageId = (body: LarkEvent.Data | LarkAction.Data) => {
if (getIsEventMsg(body)) return body?.event?.message?.message_id
if (getIsActionMsg(body)) return body?.open_message_id
return ""
}
export { LarkAction, LarkEvent }