feat: command handlers

Add all 11 Telegraf command handler files (tasks 12–16): log, skip, status, history, streak, snooze, settings-cmd, progress, next, reschedule, chat, and setup (including multi-step onboarding flow).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 17:52:19 +02:00
parent fc57fe2415
commit c49b10e11d
12 changed files with 385 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import type { Context } from 'telegraf';
import type { Database } from 'better-sqlite3';
import { todayString } from '../../utils/date';
import { getProgressAnalysis } from '../../ai/coach';
export function handleProgress(db: Database) {
return async (ctx: Context) => {
await ctx.reply('Analysing your recent history…');
try {
const result = await getProgressAnalysis(db, todayString());
await ctx.reply(result);
} catch (err) {
await ctx.reply(`AI unavailable: ${(err as Error).message}`);
}
};
}