feat: polish Discord daily check-ins and add reminder buttons

This commit is contained in:
syntaxbullet
2026-09-08 08:20:13 +02:00
parent 2671fe0f34
commit 8b9bd75f24
7 changed files with 160 additions and 13 deletions

View File

@@ -28,6 +28,7 @@ test("reminders follow local time, send only unfinished habits, and deduplicate
await Promise.all([sendDueReminders(f.db, config, transport(sent), now), sendDueReminders(f.db, config, transport(sent), now)]);
expect(sent).toHaveLength(1); expect(sent[0]).not.toContain("Private habit name");
expect(JSON.parse(sent[0]!).allowed_mentions.parse).toEqual([]);
expect(JSON.parse(sent[0]!).components).toBeUndefined();
await sendDueReminders(f.db, config, transport(sent), now); expect(sent).toHaveLength(1);
f.setTime("2026-09-05T18:00:00Z");
await f.json(`/habits/${habit.id}/days/2026-09-05/progress`, "PUT", { done: true });
@@ -53,7 +54,7 @@ test("quiet hours defer until their end and DST overlap sends once", async () =>
test("opt-out during channel creation cancels the message", async () => {
const { f } = await setup(); let posts = 0;
try {
await sendDueReminders(f.db, config, async url => {
await sendDueReminders(f.db, { ...config, commandsAvailable: true }, async url => {
if (!url.endsWith("/users/@me/channels")) posts++;
f.db.update(reminderSettings).set({ enabled: false }).run();
return Response.json({ id: "223456789012345678" });