SR-G / watchthatpage

Command line utility allowing to monitor remote web pages and trigger mail notifications when some modifications are detected.
Apache License 2.0
80 stars 11 forks source link

Discord addition #8

Closed vladdoster closed 2 years ago

vladdoster commented 3 years ago

Great work here.

Would you be open to reviewing and possibly merging a PR to add discord notifications? or should I just keep it in my fork?

SR-G commented 3 years ago

Hello. Sure, send it as a PR, i'll review / merge it (if it's somehow optional / configurable and not mandatory for everyone).

vladdoster commented 3 years ago

Awesome. Yes it would be opt in. And I assume it would need to be such that a user can receive both email and discord?

SR-G commented 3 years ago

Yes, the best would be to just have an extra (optional) configuration like :

"NotificationDiscord" : { 
    "discordServer" : "http://...",
    "discordCredentials" : "",
    "template" : "WatchThatPage results : {{ .NbDiff }} page(s) changed"
  }

(note : i have no idea how discord notification is working about API + credentials, so this is obviously just an example)

And indeed, from a code point of view, either "NotificationMail", either "NotificationDiscord", either both, can be activated.