zhaoyingbo da1c5f7580
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 32s
CI Monitor CI/CD / deploy (push) Successful in 40s
feat: 支持对PipeLine WebHooks的处理 #1
2024-07-26 07:17:32 +00:00

59 lines
1.1 KiB
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,
})
}
message.byUserIdList = async (
user_id_list: string[],
content: string,
api_key?: string
) => {
return message({
receive_id: user_id_list.join(","),
receive_id_type: "user_id",
msg_type: "interactive",
content,
api_key,
})
}
export default message