-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add /remind command with natural language time parsing #153
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8ff5d93
feat: add /remind command with natural language time parsing
e5212f2
fix(remind): default reminders.enabled to false to match other option…
aa10c9a
fix(remind): add null pool guard in checkReminders to prevent crash w…
ac92b55
fix(remind): add reminders schema to CONFIG_SCHEMA for API validation
e5f1439
fix(remind): resolve circular dep, delivery retry, pool checks, index
95bd7d4
Fix 1: Add per-guild reminders.enabled check in checkReminders
b0977df
Fix 2: Add setMaxLength constraints to 'when' and 'message' options
df108f9
Fix 3: Add composite index for per-user reminder queries
890ddd4
Fix 4: Fix time parser regex to handle spaced am/pm
7119ee3
Fix 5: Remove dead maxRecurring from config validation schema
79abf7e
fix(remind): round 2 — guild check, snooze guard, TS cast, max length
bd015e0
fix(remind): round 2b — consistent enabled check, getConfig mock in t…
6e81e12
fix: allow remind command in permissions
59707c8
fix: make reminder creation atomic and handle db failures
1bd6271
fix: resolve merge conflicts with main - keep both reminders and audi…
BillChirico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * Migration 015 — Reminders | ||
| * Creates the reminders table for the personal reminder system. | ||
| * | ||
| * @see https://github.com/VolvoxLLC/volvox-bot/issues/137 | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| /** | ||
| * @param {import('pg').Pool} pool | ||
| */ | ||
| async function up(pool) { | ||
| await pool.query(` | ||
| CREATE TABLE IF NOT EXISTS reminders ( | ||
| id SERIAL PRIMARY KEY, | ||
| guild_id VARCHAR NOT NULL, | ||
| user_id VARCHAR NOT NULL, | ||
| channel_id VARCHAR NOT NULL, | ||
| message TEXT NOT NULL, | ||
| remind_at TIMESTAMPTZ NOT NULL, | ||
| recurring_cron VARCHAR, | ||
| snoozed_count INT NOT NULL DEFAULT 0, | ||
| failed_delivery_count INT NOT NULL DEFAULT 0, | ||
| completed BOOLEAN NOT NULL DEFAULT FALSE, | ||
| created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() | ||
| ); | ||
| `); | ||
|
|
||
| await pool.query(` | ||
| CREATE INDEX IF NOT EXISTS idx_reminders_due | ||
| ON reminders(remind_at) WHERE completed = false; | ||
| `); | ||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| await pool.query(` | ||
| CREATE INDEX IF NOT EXISTS idx_reminders_user_active | ||
| ON reminders(guild_id, user_id) WHERE completed = false; | ||
| `); | ||
|
|
||
| await pool.query(` | ||
| CREATE INDEX IF NOT EXISTS idx_reminders_user | ||
| ON reminders(guild_id, user_id, completed); | ||
| `); | ||
| } | ||
|
|
||
| module.exports = { up }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.