-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental push notification support (via NTFY) #227
base: 1.5
Are you sure you want to change the base?
Conversation
- Push notifications via NTFY. Only keywords, warn, and error are pushed.
completed tasks for (to remove other completed messages). Press the number to show 2FA codes.
Fixes unsent notifications. Notifications match keywords in log, error, and warn. NTFY title, priority, emoji, and body sent. Since push, not all warn, log, or error wanted.
With thanks to @AariaX for fixing notification sending via axios
Typo, forgot 'log', whoops
Placeholder for when support for 'the script collected xxx points' is working in index.ts. This will push the total points collected as a notification
Microsoft-Rewards-Script/src/index.ts Line 100 in 2a1a90c
Changing this to "Completed tasks for ALL accounts" might be nice? |
Co-authored-by: AariaX <[email protected]>
I do get a [LOG] line that says 'completed tasks for ALL accounts' for each cluster/account = 2 notifications. I do personally prefer having it 'completed for email' instead so I could verify both completed. If this change would generate one summary notification for all clusters that is beneficial. If it shows up as a [WARN] it would be easier to isolate from logs, but as a notification it might also (at a glance) look like there's a problem if it does show up with the warn tag. Does all workers destroyed == tasks completed? Then there'd be no harm in changing it. |
This PR adds experimental push notification support via NTFY, closing FR #90
Summary of changes:
config.json
, parsed usingConfig.ts
Logger.ts
matches [LOG], [ERROR], and [WARN] against customizable key words to generate notifications (with comments added to show where such customization can occur)Ntfy.sh
sends customizable notifications usingAxios.ts
, which include emojis and prioritization based on type (e.g., high priority for warnings).Readme
updated to briefly describe setup, and customization options.By default, notifications are sent for each account: script started, 2FA/passwordless code, script successfully completed, and major warnings (e.g., searches not completed).
Huge thanks to @AariaX for fixing axios support for sending.