mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
feat(notification): add pushover priority setting (#186)
This commit is contained in:
@@ -19,6 +19,7 @@ PLAY_SOUND=""
|
||||
PUSHBULLET=""
|
||||
PUSHOVER_TOKEN=""
|
||||
PUSHOVER_USER=""
|
||||
PUSHOVER_PRIORITY=""
|
||||
PAGE_SLEEP_MIN=""
|
||||
PAGE_SLEEP_MAX=""
|
||||
SHOW_ONLY_BRANDS=""
|
||||
|
||||
@@ -82,6 +82,7 @@ Here is a list of variables that you can use to customize your newly copied `.en
|
||||
| `PUSHBULLET` | PushBullet API key | Generate at https://www.pushbullet.com/#settings/account | |
|
||||
| `PUSHOVER_TOKEN` | Pushover access token | Generate at https://pushover.net/apps/build | |
|
||||
| `PUSHOVER_USER` | Pushover username | |
|
||||
| `PUSHOVER_PRIORITY` | Pushover message priority |
|
||||
| `PAGE_SLEEP_MIN` | Minimum sleep time between queries of the same store | In milliseconds, default: `5000` |
|
||||
| `PAGE_SLEEP_MAX` | Maximum sleep time between queries of the same store | In milliseconds, default: `10000` |
|
||||
| `SCREENSHOT` | Capture screenshot of page if a card is found | Default: `true` |
|
||||
|
||||
@@ -88,6 +88,7 @@ const notifications = {
|
||||
playSound: envOrString(process.env.PLAY_SOUND),
|
||||
pushBulletApiKey: envOrString(process.env.PUSHBULLET),
|
||||
pushover: {
|
||||
priority: envOrString(process.env.PUSHOVER_PRIORITY),
|
||||
token: envOrString(process.env.PUSHOVER_TOKEN),
|
||||
username: envOrString(process.env.PUSHOVER_USER)
|
||||
},
|
||||
|
||||
@@ -12,6 +12,7 @@ const push = new Push({
|
||||
export function sendPushoverNotification(link: Link, store: Store) {
|
||||
const message = {
|
||||
message: link.cartUrl ? link.cartUrl : link.url,
|
||||
priority: pushover.priority,
|
||||
title: Print.inStock(link, store)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user