20 lines
480 B
TypeScript
20 lines
480 B
TypeScript
import LarkBody from "./Body"
|
|
import LarkCard from "./Card"
|
|
import * as CardComponent from "./Card/component"
|
|
import { LarkAction, LarkEvent } from "./types"
|
|
|
|
/**
|
|
* 生成消息卡片的Options
|
|
*/
|
|
export const genCardOptions = (options: Record<string, string>) => {
|
|
return Object.entries(options).map(([text, value]) => ({
|
|
text: {
|
|
tag: "plain_text",
|
|
content: text,
|
|
},
|
|
value,
|
|
}))
|
|
}
|
|
|
|
export { CardComponent, LarkAction, LarkBody, LarkCard, LarkEvent }
|