feat: 添加发送CI监控消息的函数
This commit is contained in:
parent
c2fcd6387d
commit
8b917546d7
@ -62,10 +62,19 @@ const filterIllegalMsg = (body: LarkMessageEvent) => {
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 发送CI监控消息
|
||||
* @param chatId - 发送消息的chatId
|
||||
*/
|
||||
const manageCIMsg = async (chatId: string) => {
|
||||
lark.sendMsg("chat_id", chatId, "interactive", await fetchCIMonitor());
|
||||
};
|
||||
|
||||
/**
|
||||
* 发送简报消息
|
||||
* @param chatId - 发送消息的chatId
|
||||
* @param msg - 消息内容
|
||||
*/
|
||||
const manageReportMsg = async (chatId: string, msg: string) => {
|
||||
lark.sendMsg(
|
||||
"chat_id",
|
||||
@ -75,6 +84,10 @@ const manageReportMsg = async (chatId: string, msg: string) => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 发送ID消息
|
||||
* @param chatId - 发送消息的chatId
|
||||
*/
|
||||
const manageIdMsg = async (chatId: string) => {
|
||||
const content = JSON.stringify({
|
||||
type: "template",
|
||||
@ -91,6 +104,11 @@ const manageIdMsg = async (chatId: string) => {
|
||||
lark.sendMsg("chat_id", chatId, "interactive", content);
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理命令消息
|
||||
* @param body - 消息体
|
||||
* @returns
|
||||
*/
|
||||
const manageCMDMsg = (body: LarkMessageEvent) => {
|
||||
const text = getMsgText(body);
|
||||
const chatId = getChatId(body);
|
||||
|
Loading…
x
Reference in New Issue
Block a user