c49b10e11d
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>
17 lines
540 B
TypeScript
17 lines
540 B
TypeScript
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}`);
|
|
}
|
|
};
|
|
}
|