一个使用 通知 事件的例子

检测到达美乐披萨中一等奖的通知时 再大力通知

Surge 配置

[Script]
Notification = script-path=notification.js,type=event,event-name=notification


脚本 notification.js 内容

新版不能在此事件脚本里再发通知了 可改为 HTTP 请求 Bark 之类的:

一个例子

下面的脚本内容不用看了 仅备份

// console.log(JSON.stringify($event, null, 2))
const { name, data: { title, subtitle, body } } = $event
if (/达乐美|达美乐/.test(title) && /一等奖/.test(body)) {
  $notification.post(`🎉 一等奖!!! ${title}`, subtitle, body, { 'media-url': 'https://www.dominos.com.cn/assets/img/logo.a75b8846.png', sound: 1 })
}
$done()


模块脚本合集 合集 群组 恰饭 联系推广

#Surge #模块 #脚本 #通知 #配置 #示例 #达美乐 #达乐美