set send dingtalk message with delay

This commit is contained in:
bossgeekgo
2024-02-11 18:42:36 +08:00
parent e9bba46b50
commit 3d3a87bd79
3 changed files with 57 additions and 13 deletions
+10 -7
View File
@@ -1,13 +1,16 @@
export function createTextMessage (text) {
return JSON.stringify({
"msgtype": "text",
"text": {
"content": `${text}【bossgeekgo】`
}
})
return {
"dingtalkRequestBody": {
"msgtype": "text",
"text": {
"content": `${text}`
},
},
insertedTime: new Date(),
}
}
export async function requestDingTalkNotify (dingTalkAccessToken, body) {
export async function requestDingtalkNotify (dingTalkAccessToken, body) {
const url = new URL(`https://oapi.dingtalk.com/robot/send`)
url.searchParams.append(
'access_token',