This commit is contained in:
parent
fef88df67e
commit
075e8f60eb
@ -64,7 +64,7 @@ class LarkMessageService extends LarkBaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息历史记录
|
||||
* <EFBFBD><EFBFBD><EFBFBD>取消息历史记录
|
||||
* @param chatId 会话ID
|
||||
* @param startTime 开始时间 秒级时间戳
|
||||
* @param endTime 结束时间 秒级时间戳
|
||||
@ -97,6 +97,27 @@ class LarkMessageService extends LarkBaseService {
|
||||
message: "ok",
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回复消息
|
||||
* @param messageId 消息ID
|
||||
* @param msgType 消息类型 包括:text、post、image、file、audio、media、sticker、interactive、share_chat、share_user
|
||||
* @param content 消息内容
|
||||
*/
|
||||
async reply(
|
||||
messageId: string,
|
||||
msgType: Lark.MsgType,
|
||||
content: string | Record<string, any>
|
||||
) {
|
||||
const path = `/im/v1/messages/${messageId}/reply`
|
||||
if (typeof content === "object") {
|
||||
content = JSON.stringify(content)
|
||||
}
|
||||
if (msgType === "text" && !content.includes('"text"')) {
|
||||
content = JSON.stringify({ text: content })
|
||||
}
|
||||
return this.post<Lark.BaseRes>(path, { msg_type: msgType, content })
|
||||
}
|
||||
}
|
||||
|
||||
export default LarkMessageService
|
||||
|
Loading…
x
Reference in New Issue
Block a user