zhaoyingbo 71461a04df
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 28s
CI Monitor CI/CD / deploy (push) Successful in 28s
feat: 更新GitLab API调用方法
2024-07-01 12:33:40 +00:00

35 lines
662 B
TypeScript

import netTool from "./netTool";
const sendMessage = async (body: any) => {
const URL = "https://egg.imoaix.cn/message";
try {
const res = await netTool.post(URL, JSON.stringify(body));
return res;
} catch {
return null;
}
};
sendMessage.byGroupId = async (group_id: string, content: string) => {
return sendMessage({
group_id,
msg_type: "interactive",
content,
});
};
sendMessage.byChatId = async (chat_id: string, content: string) => {
return sendMessage({
receive_id: chat_id,
receive_id_type: "chat_id",
msg_type: "interactive",
content,
});
};
const egg = {
sendMessage,
};
export default egg;