Pre Merge pull request !137 from 千奈千祁/N/A
This commit is contained in:
commit
aae8102aca
|
@ -3,3 +3,6 @@ iyuu:
|
||||||
|
|
||||||
# Server酱(https://sct.ftqq.com/)
|
# Server酱(https://sct.ftqq.com/)
|
||||||
sct:
|
sct:
|
||||||
|
|
||||||
|
# 飞书自定义机器人Webhook (https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot)
|
||||||
|
feishu_webhook:
|
|
@ -21,5 +21,30 @@ export default class offlineEvent extends EventListener {
|
||||||
if (config.sct) {
|
if (config.sct) {
|
||||||
await fetch(`https://sctapi.ftqq.com/${config.sct}.send?title=${title}&content=${e.message}`)
|
await fetch(`https://sctapi.ftqq.com/${config.sct}.send?title=${title}&content=${e.message}`)
|
||||||
}
|
}
|
||||||
|
if (config.feishu_webhook){
|
||||||
|
let offline_content = {
|
||||||
|
msg_type: 'post',
|
||||||
|
content: {
|
||||||
|
post: {
|
||||||
|
'zh-cn': {
|
||||||
|
title: title,
|
||||||
|
content: [
|
||||||
|
[{
|
||||||
|
tag: "text",
|
||||||
|
text: e.message
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fetch(config.feishu_webhook, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(offline_content)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue