egg_server/test/archive/getChatHistory.ts
zhaoyingbo 1153183869
All checks were successful
Egg Server CI/CD / build-image (push) Successful in 50s
Egg Server CI/CD / refresh-image (push) Successful in 14s
Egg Server CI/CD / fast-deploy (push) Successful in 2s
feat: 分离小煎蛋和michat的指令
2024-10-23 09:44:56 +00:00

49 lines
1.5 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 logger from "@egg/logger"
// import getChatHistory from "../../routes/bot/groupAgent/chatHistory"
// import { LarkService } from "../../services"
// const service = new LarkService("michat", "")
// const currentTime = Math.floor(new Date().getTime() / 1000)
// const weekAgoTime = currentTime - 7 * 24 * 60 * 60
// const res = await service.message.getHistory(
// "oc_bd23da1ae9948654fc04365d7d102d73",
// weekAgoTime.toString(),
// currentTime.toString()
// )
// // const res = await getChatHistory(
// // { larkService: service, logger: logger },
// // {
// // chatId: "oc_bd23da1ae9948654fc04365d7d102d73",
// // timeScope: "",
// // startTime: "2024-10-16 00:00:00",
// // endTime: "2024-10-24 00:00:00",
// // mentions: [],
// // }
// // )
// // {
// // "user": "左建光",
// // "content": "Anthropic经过一番操作已经是和openai并肩的AI双雄了[呲牙]",
// // "time": "2024/10/23 09:25:33"
// // },
// // {
// // "user": "魏柏楠",
// // "content": "@Mi Chat /id",
// // "time": "2024/10/23 10:02:42"
// // }
// console.log(JSON.stringify(res, null, 2))
// // 把res内容输出到csv文件保留user、content、time字段使用逗号分隔
// // 手写代码实现
// const fileContent = res
// .filter(({ user, content, time }) => user && content && time)
// .map(
// ({ user, content, time }) =>
// `${time},${user},${content.replace(/,/g, "").replace(/\n/g, " ")}`
// )
// .join("\n")
// await Bun.write("output.csv", fileContent)