!notify command creates reminders that will send you a WhatsApp message at a specified time in the future.
Basic Usage
The reminder message or task description
Duration from now when you want to be reminded. Supports formats like
30m, 1h, 2h30mExamples
Simple Reminders
Hour-based Reminders
Complex Durations
Time Format
The time parameter supports flexible formats:| Format | Description | Example |
|---|---|---|
<number>m | Minutes only | 30m = 30 minutes |
<number>h | Hours only | 2h = 2 hours |
<number>h<number>m | Hours and minutes | 1h30m = 1 hour 30 min |
The time parser extracts hours and minutes from the string, so
2h30m and 30m2h both work (though the first format is recommended for clarity).How It Works
Parse the command
The bot separates your task description from the time duration. The last argument is treated as the time, everything before it is the task.Example:
!notify call dentist tomorrow 45m- Task: “call dentist tomorrow”
- Time: “45m”
Calculate reminder time
The bot calculates the exact time to send the reminder using the current time plus the duration you specified.Implementation in NotifyHandler.ts:36:
Store the reminder
The reminder is saved to the database with your user ID, task, and scheduled time.From NotifyHandler.ts:39-43:
Error Handling
Missing Parameters
Missing Time
Invalid Time Format
Implementation Details
Time Parser
From NotifyHandler.ts:59-73, the time parser uses regex to extract hours and minutes:Duration Formatting
The confirmation message formats the duration in a human-readable way (NotifyHandler.ts:75-86):Can I set multiple reminders?
Can I set multiple reminders?
Yes! Each
!notify command creates a separate reminder. You can have multiple reminders scheduled at different times.What's the maximum reminder duration?
What's the maximum reminder duration?
The code doesn’t impose a maximum limit, but extremely long durations should be used cautiously as they depend on the bot staying online.
Can I cancel a reminder?
Can I cancel a reminder?
The current implementation doesn’t include a cancel feature. Once set, reminders will trigger at their scheduled time. This could be a future enhancement.