diff --git a/.env-example b/.env-example index d470a64..bc76bf2 100644 --- a/.env-example +++ b/.env-example @@ -19,6 +19,7 @@ PLAY_SOUND="" PUSHBULLET="" PUSHOVER_TOKEN="" PUSHOVER_USER="" +PUSHOVER_PRIORITY="" PAGE_SLEEP_MIN="" PAGE_SLEEP_MAX="" SHOW_ONLY_BRANDS="" diff --git a/README.md b/README.md index e9d4f2b..4e2350b 100644 --- a/README.md +++ b/README.md @@ -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` | diff --git a/src/config.ts b/src/config.ts index 2957f57..88daf25 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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) }, diff --git a/src/notification/pushover.ts b/src/notification/pushover.ts index d038924..2c08785 100644 --- a/src/notification/pushover.ts +++ b/src/notification/pushover.ts @@ -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) };