Add alerts, currency conversion and notifications.
Items fire when a page is available from an accepted seller at or below max_price, converted with the ECB's daily rates when the page uses another currency. A per-item cooldown, kept in the state file, holds back repeat alerts unless the price drops. Alerts go to Discord, ntfy and JSON webhooks with retries, and to the desktop; 'dibs notify test' sends a sample.
This commit is contained in:
1 parent
2175c0e5aa
commit
8f0eda5d4d
16 files changed
+1409
-15
No files matched your search
@@ -314,8 +314,8 @@ func (v *validator) notify(n *Notify) {
|
||||
}
|
||||
}
|
||||
|
||||
if n.Cooldown.Duration < 0 {
|
||||
v.errorf("notify.cooldown", "must not be negative (got %s)", n.Cooldown)
|
||||
if n.Cooldown.Duration < 0 || n.Cooldown.Duration > MaxCooldown {
|
||||
v.errorf("notify.cooldown", "must be between 0s and %gh (got %s)", MaxCooldown.Hours(), n.Cooldown)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user