All checks were successful
CI Monitor MIflow / build-image (push) Successful in 38s
将消息服务的URL地址从"https://egg.imoaix.cn/message"更新为"https://lark-egg.ai.xiaomi.com/message",以适应新的服务地址。
59 lines
1.1 KiB
TypeScript
59 lines
1.1 KiB
TypeScript
import netTool from "../netTool"
|
|
|
|
const API_KEY = "1dfz4wlpbbgiky0"
|
|
const URL = "https://lark-egg.ai.xiaomi.com/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
|