zhaoyingbo 3f220f7943
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 29s
CI Monitor CI/CD / deploy (push) Successful in 34s
style: 优化项目结构
2024-07-24 10:35:50 +00:00

45 lines
867 B
TypeScript

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