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

Function pushplus

utils/pushplus.ts:12–39  ·  view source on GitHub ↗
(title: string, content: string, template: string = 'html')

Source from the content-addressed store, hash-verified

10}
11
12export async function pushplus(title: string, content: string, template: string = 'html'): Promise<void> {
13 let token: string
14 for (let user of account) {
15 if (content.includes(decodeURIComponent(user.pt_pin)) && user.pushplus) {
16 token = user.pushplus
17 break
18 }
19 }
20 if (!token) {
21 console.log('no pushplus token')
22 return
23 }
24 let {data}: any = await axios.post('https://www.pushplus.plus/send', {
25 token: token,
26 title: title,
27 content: content,
28 template: template
29 }, {
30 headers: {
31 'Content-Type': 'application/json'
32 }
33 })
34 if (data.code === 200) {
35 console.log('pushplus发送成功')
36 } else {
37 console.log('pushplus发送失败', JSON.stringify(data))
38 }
39}

Callers

nothing calls this directly

Calls 2

logMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected