MCPcopy Create free account
hub / github.com/Toulu-debug/enen / BarkNotify

Function BarkNotify

sendNotify.js:355–389  ·  view source on GitHub ↗
(text, desp, params = {})

Source from the content-addressed store, hash-verified

353}
354
355function BarkNotify(text, desp, params = {}) {
356 return new Promise(resolve => {
357 if (BARK_PUSH) {
358 const options = {
359 url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&group=${BARK_GROUP}&${querystring.stringify(params)}`,
360 headers: {
361 'Content-Type': 'application/x-www-form-urlencoded'
362 },
363 timeout
364 }
365 $.get(options, (err, resp, data) => {
366 try {
367 if (err) {
368 console.log('Bark APP发送通知调用API失败!!\n')
369 console.log(err);
370 } else {
371 data = JSON.parse(data);
372 if (data.code === 200) {
373 console.log('Bark APP发送通知消息成功🎉\n')
374 } else {
375 console.log(`${data.message}\n`);
376 }
377 }
378 } catch (e) {
379 $.logErr(e, resp);
380 } finally {
381 resolve();
382 }
383 })
384 } else {
385 // console.log('您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知🚫\n');
386 resolve()
387 }
388 })
389}
390
391function tgBotNotify(text, desp) {
392 return new Promise(resolve => {

Callers 1

sendNotifyFunction · 0.85

Calls 3

getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected