sendNotify.js 增加第四个参数,可供填写作者信息

This commit is contained in:
lxk0301
2021-04-02 09:32:05 +08:00
parent 72cc5efdc8
commit 37d6f0e059
2 changed files with 19 additions and 12 deletions

View File

@@ -134,10 +134,17 @@ if (process.env.PUSH_PLUS_USER) {
}
//==========================云端环境变量的判断与接收=========================
async function sendNotify(text, desp, params = {}) {
/**
* 推送通知功能
* @param text 通知头
* @param desp 通知体
* @param params 某些推送通知方式点击弹窗可跳转, 例:{ url: 'https://abc.com' }
* @param author 作者仓库等信息 例:`本脚本免费使用 Byhttps://gitee.com/lxk0301/jd_docker`
* @returns {Promise<unknown>}
*/
async function sendNotify(text, desp, params = {}, author = '\n\n本脚本免费使用 Byhttps://gitee.com/lxk0301/jd_docker') {
//提供6种通知
desp += `\n\n本脚本免费使用 Byhttps://gitee.com/lxk0301/jd_docker`;
desp += author;//增加作者信息,防止被贩卖等
await Promise.all([
serverNotify(text, desp),//微信server酱
pushPlusNotify(text, desp)//pushplus(推送加)