mirror of
https://github.com/sune-org/us.proxy.sune.chat.git
synced 2026-03-16 18:11:01 +00:00
15 lines
347 B
JavaScript
15 lines
347 B
JavaScript
const NTFY_URL = process.env.NTFY_URL || ''
|
|
|
|
export function notify(msg, priority = 3, tags = []) {
|
|
if (!NTFY_URL) return
|
|
fetch(NTFY_URL, {
|
|
method: 'POST',
|
|
body: msg,
|
|
headers: {
|
|
Title: 'us.proxy.sune.chat',
|
|
Priority: `${priority}`,
|
|
Tags: tags.join(','),
|
|
},
|
|
}).catch(e => console.error('ntfy failed:', e))
|
|
}
|