Skip to content

Reminders: /remind <when> <text>#18

Open
cristoforows wants to merge 1 commit into
mainfrom
wesley/reminders
Open

Reminders: /remind <when> <text>#18
cristoforows wants to merge 1 commit into
mainfrom
wesley/reminders

Conversation

@cristoforows

Copy link
Copy Markdown
Owner

Closes #13.

What

Auth-gated /remind that schedules a one-off Telegram nudge back to the chat. e.g. /remind 30m drink water, /remind 2h call the dentist, /remind 1d renew passport. /remind list shows pending reminders.

How

  • reminders.py (new): pure parse_reminder (<duration> <text>; bare number = minutes; units s/m/h/d; capped at 30 days) + humanize. remind_command schedules context.job_queue.run_once; the callback DMs the text back. Jobs are named reminder:<chat>:<msg> so /remind list can filter this chat's pending jobs.
  • bot.py: registers /remind, adds it to help/start text.

Notes

  • Uses the PTB [job-queue] extra already in requirements (same mechanism as the /timebox session timeout).
  • Reminders live in the job queue in memory — they do not survive a process restart. Acceptable for a personal bot; a durable store could be a follow-up.

Test

  • tests/test_reminders.py: valid/invalid parsing + humanize. Full suite green (26 passed).

New reminders.py command (auth-gated). Parses '<when> <what>' (30m/2h/
1d, bare number = minutes), schedules a job_queue.run_once nudge, and
supports /remind list for pending ones. Reminders are in-memory (lost on
restart). Closes #13.
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

Successfully merging this pull request may close these issues.

Reminders: /remind <when> <text>

1 participant