feat(net-tool): 更新 updateReplyCard 方法为 updateReplyMessage,支持消息类型参数
All checks were successful
/ release (push) Successful in 24s
All checks were successful
/ release (push) Successful in 24s
This commit is contained in:
parent
4833445e63
commit
5e14057abc
@ -145,18 +145,22 @@ class LarkMessageService extends LarkBaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新回复卡片消息
|
||||
* 更新或回复消息
|
||||
* @param messageId 消息ID
|
||||
* @returns 一个异步函数,用于更新或回复卡片消息
|
||||
* @param msgType 消息类型 包括:text、interactive
|
||||
* @returns 一个异步函数,用于更新或回复消息
|
||||
*/
|
||||
updateReplyCard(messageId: string) {
|
||||
updateReplyMessage(
|
||||
messageId: string,
|
||||
msgType: "text" | "interactive" = "interactive"
|
||||
) {
|
||||
let repliedMessageId = ""
|
||||
return async (content: string) => {
|
||||
if (repliedMessageId) {
|
||||
await this.update(repliedMessageId, content)
|
||||
await this.update(repliedMessageId, content, msgType === "text")
|
||||
return repliedMessageId
|
||||
}
|
||||
const res = await this.replyCard(messageId, content)
|
||||
const res = await this.reply(messageId, msgType, content)
|
||||
if ("data" in res) {
|
||||
repliedMessageId = res.data.message_id
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user