* sendNotify 推送通知功能 * @param text 通知头 * @param desp 通知体 * @param params 某些推送通知方式点击弹窗可跳转, 例:{ url: 'https://abc.com' } * @returns {Promise }
(text, desp, params = {})
| 1502 | * @returns {Promise<unknown>} |
| 1503 | */ |
| 1504 | async function sendNotify(text, desp, params = {}) { |
| 1505 | // 根据标题跳过一些消息推送,环境变量:SKIP_PUSH_TITLE 用回车分隔 |
| 1506 | let skipTitle = process.env.SKIP_PUSH_TITLE; |
| 1507 | if (skipTitle) { |
| 1508 | if (skipTitle.split('\n').includes(text)) { |
| 1509 | console.info(text + '在 SKIP_PUSH_TITLE 环境变量内,跳过推送'); |
| 1510 | return; |
| 1511 | } |
| 1512 | } |
| 1513 | |
| 1514 | if (push_config.HITOKOTO !== 'false') { |
| 1515 | desp += '\n\n' + (await one()); |
| 1516 | } |
| 1517 | |
| 1518 | await Promise.all([ |
| 1519 | serverNotify(text, desp), // 微信server酱 |
| 1520 | pushPlusNotify(text, desp), // pushplus |
| 1521 | wePlusBotNotify(text, desp), // 微加机器人 |
| 1522 | barkNotify(text, desp, params), // iOS Bark APP |
| 1523 | tgBotNotify(text, desp), // telegram 机器人 |
| 1524 | ddBotNotify(text, desp), // 钉钉机器人 |
| 1525 | qywxBotNotify(text, desp), // 企业微信机器人 |
| 1526 | qywxamNotify(text, desp), // 企业微信应用消息推送 |
| 1527 | iGotNotify(text, desp, params), // iGot |
| 1528 | gobotNotify(text, desp), // go-cqhttp |
| 1529 | gotifyNotify(text, desp), // gotify |
| 1530 | chatNotify(text, desp), // synolog chat |
| 1531 | pushDeerNotify(text, desp), // PushDeer |
| 1532 | aibotkNotify(text, desp), // 智能微秘书 |
| 1533 | fsBotNotify(text, desp), // 飞书机器人 |
| 1534 | smtpNotify(text, desp), // SMTP 邮件 |
| 1535 | pushMeNotify(text, desp, params), // PushMe |
| 1536 | chronocatNotify(text, desp), // Chronocat |
| 1537 | webhookNotify(text, desp), // 自定义通知 |
| 1538 | qmsgNotify(text, desp), // 自定义通知 |
| 1539 | ntfyNotify(text, desp), // Ntfy |
| 1540 | wxPusherNotify(text, desp), // wxpusher |
| 1541 | ]); |
| 1542 | } |
| 1543 | |
| 1544 | module.exports = { |
| 1545 | sendNotify, |
nothing calls this directly
no test coverage detected