From 42014cb969a272c303f020dcc77f5a120dc23dd7 Mon Sep 17 00:00:00 2001 From: Kokomi <102026640+yoimiya-kokomi@users.noreply.github.com> Date: Wed, 31 Jan 2024 04:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0merge=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=A2=AB=E5=90=9E=E4=BA=86=20(#361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 飞书自定义群机器人Webhook掉线通知 喵佬看看爱发电啊,我的token还没续上T_T * 将 centos7 "CXXABI_1.3.8" not found 列入常见问题解决方法 --------- Co-authored-by: 千奈千祁 <2632139786@qq.com> --- README.md | 9 +++++++++ config/default_config/notice.yaml | 5 ++++- lib/events/offline.js | 25 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4ecb28..9166236 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,15 @@ linux环境,其他环境请自行探索 yum groupinstall fonts -y ``` +### centos7 监听事件错误 "CXXABI_1.3.8" not found 解决办法 +下载 [libstdc++.so.6.0.29.zip](https://baiyin1314.lanzouq.com/i8Nr21ig8hyf) 将 **解压缩后** 的文件放在/usr/lib64/中 +``` +cd /usr/lib64/ +sudo mv libstdc++.so.6 libstdc++.so.6.bak +sudo ln -s libstdc++.so.6.0.29 libstdc++.so.6 +``` + + ## 致谢 | Nickname | Contribution | diff --git a/config/default_config/notice.yaml b/config/default_config/notice.yaml index 0db3a25..b136606 100644 --- a/config/default_config/notice.yaml +++ b/config/default_config/notice.yaml @@ -2,4 +2,7 @@ iyuu: # Server酱(https://sct.ftqq.com/) -sct: \ No newline at end of file +sct: + +# 飞书自定义机器人Webhook (https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot) +feishu_webhook: \ No newline at end of file diff --git a/lib/events/offline.js b/lib/events/offline.js index 6c0a57f..d6c5f38 100644 --- a/lib/events/offline.js +++ b/lib/events/offline.js @@ -21,5 +21,30 @@ export default class offlineEvent extends EventListener { if (config.sct) { 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 + }] + ] + } + } + } + }; + await fetch(config.feishu_webhook, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(offline_content) + }) + } } }