Compare commits

...

2 Commits

Author SHA1 Message Date
2db50b0e6b chore(release): publish
- @egg/net-tool@1.26.0
2025-01-24 07:47:20 +00:00
af7e446b8e feat(net-tool): 添加更新回复卡片消息的方法
All checks were successful
/ release (push) Successful in 26s
2025-01-24 07:46:54 +00:00
4 changed files with 27 additions and 2 deletions

2
package-lock.json generated
View File

@ -12394,7 +12394,7 @@
},
"packages/net-tool": {
"name": "@egg/net-tool",
"version": "1.25.0",
"version": "1.26.0",
"license": "ISC",
"dependencies": {
"@egg/logger": "^1.6.0",

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.26.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/net-tool@1.25.0...@egg/net-tool@1.26.0) (2025-01-24)
### Features
- **net-tool:** 添加更新回复卡片消息的方法 ([af7e446](http://yingbo.im:3000/zhaoyingbo/egg_tools/commits/af7e446b8e8012dd7170fec84e0ad3ba5a5e452b))
# [1.25.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/net-tool@1.24.0...@egg/net-tool@1.25.0) (2025-01-23)
### Features

View File

@ -1,6 +1,6 @@
{
"name": "@egg/net-tool",
"version": "1.25.0",
"version": "1.26.0",
"description": "Net Tools for Egg projects",
"type": "module",
"main": "src/index.ts",

View File

@ -143,6 +143,25 @@ class LarkMessageService extends LarkBaseService {
async replyCard(messageId: string, content: string | Record<string, any>) {
return this.reply(messageId, "interactive", content)
}
/**
*
* @param messageId ID
* @returns
*/
async updateReplyCard(messageId: string) {
let repliedMessageId = ""
return async (content: string) => {
if (repliedMessageId) {
await this.update(repliedMessageId, content)
return
}
const res = await this.replyCard(messageId, content)
if ("data" in res) {
repliedMessageId = res.data.message_id
}
}
}
}
export default LarkMessageService