feat: manage routine tasks through Discord forms and recurrence controls
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user