Skip to content
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

Add reminder support #24

Open
allygator opened this issue May 24, 2020 · 3 comments
Open

Add reminder support #24

allygator opened this issue May 24, 2020 · 3 comments

Comments

@allygator
Copy link
Owner

This might not be possible with the current setup, but support for "fred remind X to Y in Z (time unit)" has been requested.

@SammyIsra
Copy link
Collaborator

SammyIsra commented May 25, 2020

If we approach this we're getting into hosted DB territory which would be over our budget of "however much electricity the Pi consumes"

@allygator
Copy link
Owner Author

allygator commented May 25, 2020

We could host a database on the pi, online options could also include firebase maybe?

@asasine
Copy link

asasine commented Jul 19, 2020

SQLite is usually pretty easy to configure for local storage. It could track four things:

  • X (who to ping)
  • Y (user provided message)
  • Z (datetime in the future or timespan offset from now)
  • Complete (whether or not the reminder has been reminded, to avoid spamming)

Finding overdue and incomplete reminders is then a simple SQL query where Z >= NOW && !Complete

For normal operation, we set a timer for every incomplete reminder, send a ping when the timer wakes up, and mark the reminder as complete in the DB. Alternatively, we can use a timer on a fixed interval (e.g. 1 minute) that scans for incomplete, overdue reminders and sends at that time. You might get some inorganic batching this way if there are multiple reminders within the same interval (but were actually seconds apart in real life).

For times that become overdue when fred is down, we don't need hosting if late reminders are acceptable. On startup, fred can check for all that have not been reminded and are overdue and ping with a polite "Whoops! Bots need vacations too. Here's your [reminder]."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants