feat: manage routine tasks through Discord forms and recurrence controls

This commit is contained in:
syntaxbullet
2026-09-08 08:24:25 +02:00
parent 07a0f80fc0
commit ab2aa74eba
4 changed files with 195 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ import { ApiError, HabitService } from '../habits/service';
import { ControlStore } from './state';
import { interactionSchema, type Context, type Reply } from './types';
import { dailyAction, today } from './daily';
import { manageHabits, managementAction } from './management';
import { manageHabits, manageTasks, managementAction } from './management';
import { message } from './ui';
import { help } from './help';
@@ -48,6 +48,7 @@ export function createDiscordRoutes(db: AppDatabase, config: CommandConfig, now
let result: Reply;
try {
if (i.type === 4) result = { type: 8, data: { choices: [] } };
else if (i.type === 2 && i.data?.name === 'tasks') result = manageTasks(ctx);
else if (i.type === 2 && i.data?.name === 'habits') result = manageHabits(ctx);
else if (i.type === 2 && i.data?.name === 'today') result = today(ctx);
else if ([3, 5].includes(i.type)) {