Compare commits

...

2 Commits

Author SHA1 Message Date
3ba1dbbcaf chore(release): publish
- @egg/net-tool@1.28.1
2025-01-25 09:33:00 +00:00
6da9ef7748 refactor(net-tool): 优化消息历史记录获取和回复消息设置逻辑
All checks were successful
/ release (push) Successful in 23s
2025-01-25 09:32:40 +00:00
4 changed files with 26 additions and 11 deletions

2
package-lock.json generated
View File

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

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.28.1](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/net-tool@1.28.0...@egg/net-tool@1.28.1) (2025-01-25)
**Note:** Version bump only for package @egg/net-tool
# [1.28.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/net-tool@1.27.0...@egg/net-tool@1.28.0) (2025-01-25)
### Features

View File

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

View File

@ -76,7 +76,7 @@ class LarkMessageService extends LarkBaseService {
}
/**
* <EFBFBD><EFBFBD><EFBFBD>
*
* @param chatId ID
* @param startTime
* @param endTime
@ -144,18 +144,21 @@ class LarkMessageService extends LarkBaseService {
return this.reply(messageId, "interactive", content)
}
private repliedMessageId: string = "";
private replyMessageId: string = "";
private replyMsgType: "text" | "interactive" = "interactive";
private repliedMessageId: string = ""
private replyMessageId: string = ""
private replyMsgType: "text" | "interactive" = "interactive"
/**
* ID和类型
* @param messageId ID
* @param msgType textinteractive
*/
setReplyMessage(messageId: string, msgType: "text" | "interactive" = "interactive") {
this.replyMessageId = messageId;
this.replyMsgType = msgType;
setReplyMessage(
messageId: string,
msgType: "text" | "interactive" = "interactive"
) {
this.replyMessageId = messageId
this.replyMsgType = msgType
}
/**
@ -165,10 +168,18 @@ class LarkMessageService extends LarkBaseService {
*/
async updateOrReplyMessage(content: string) {
if (this.repliedMessageId) {
await this.update(this.repliedMessageId, content, this.replyMsgType === "text")
await this.update(
this.repliedMessageId,
content,
this.replyMsgType === "text"
)
return this.repliedMessageId
}
const res = await this.reply(this.replyMessageId, this.replyMsgType, content)
const res = await this.reply(
this.replyMessageId,
this.replyMsgType,
content
)
if ("data" in res) {
this.repliedMessageId = res.data.message_id
}