zhaoyingbo d75ca80cc3
All checks were successful
Egg Server CI/CD / build-image (push) Successful in 47s
Egg Server CI/CD / refresh-image (push) Successful in 13s
Egg Server CI/CD / fast-deploy (push) Successful in 2s
feat(lark-msg): 新增卡片属性
2024-10-15 01:42:56 +00:00

144 lines
3.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { cardComponent } from "@egg/lark-msg-tool"
const functionSelector = {
config: {
update_multi: true,
},
elements: [
{
tag: "markdown",
content: "已经选中的群聊:**${chatName}**\n",
},
{
tag: "action",
actions: [
{
tag: "select_static",
placeholder: {
tag: "plain_text",
content: "请选择功能",
},
value: {
chatId: "${chatId}",
chatName: "${chatName}",
action: "sendTimeScopeSelector",
},
options: "${functions}",
},
],
},
{
tag: "hr",
},
cardComponent.commonNote,
],
header: cardComponent.pendingHeader,
}
const timeScopeSelector = {
config: {
update_multi: true,
},
elements: [
{
tag: "markdown",
content:
"已经选中群聊:**${chatName}**\n\n已经选择功能**${functionName}**\n\n请选择时间范围",
},
{
tag: "action",
actions: [
{
tag: "button",
text: {
tag: "plain_text",
content: "过去一天",
},
type: "default",
value: {
chatId: "${chatId}",
chatName: "${chatName}",
functionId: "${functionId}",
functionName: "${functionName}",
timeScope: "1",
requestId: "${requestId}",
action: "manageGroupMsg",
},
},
{
tag: "button",
text: {
tag: "plain_text",
content: "过去三天",
},
type: "default",
value: {
chatId: "${chatId}",
chatName: "${chatName}",
functionId: "${functionId}",
functionName: "${functionName}",
timeScope: "3",
requestId: "${requestId}",
action: "manageGroupMsg",
},
},
{
tag: "button",
text: {
tag: "plain_text",
content: "过去七天",
},
type: "default",
value: {
chatId: "${chatId}",
chatName: "${chatName}",
functionId: "${functionId}",
functionName: "${functionName}",
timeScope: "7",
requestId: "${requestId}",
action: "manageGroupMsg",
},
},
],
},
{
tag: "hr",
},
cardComponent.commonNote,
],
header: cardComponent.pendingHeader,
}
const resultReport = {
config: {
update_multi: true,
},
elements: [
{
tag: "markdown",
content:
"群聊:**${chatName}**,功能:**${functionName}**,总结天数:**${timeScope}**\n\n以下内容由AI模型生成耗时**${processingTime}s**",
},
{
tag: "hr",
},
{
tag: "markdown",
content: "${llmRes}",
},
{
tag: "hr",
},
cardComponent.commonNote,
],
header: cardComponent.successHeader,
}
const cardMap = {
functionSelector,
timeScopeSelector,
resultReport,
}
export default cardMap