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:
@@ -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}`);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user