feat: telegram bot (grammy webhook) — full parity channel
- pairing (admin code -> chat link), bundling of forwarded images via drafts+quiet-window sweeper - recipe pick via inline keyboard, job (origin=telegram) creation, one summary reply with result files + links - compressed-photo detection/flag; /start /help /rezepte /status - webhook route (secret token), admin pairing-code + links endpoints, AdminApp telegram section - worker notifies chat on completion; migration 002 adds jobs.telegram_chat_id; setupTelegram on init
This commit is contained in:
+9
-1
@@ -56,6 +56,14 @@ async function maybeComplete(jobId: string): Promise<void> {
|
||||
[jobId]);
|
||||
// Picdrop-Auslieferung für alle offenen Positionen anstoßen.
|
||||
try { await deliverPendingForJob(jobId); } catch (e) { console.error('[worker] Auslieferung:', e); }
|
||||
// TODO: Benachrichtigung (Telegram/n8n).
|
||||
// Telegram-Rückmeldung, wenn der Auftrag aus einem Chat kam.
|
||||
const jt = await one<{ origin: string; telegram_chat_id: string | null }>(
|
||||
'SELECT origin, telegram_chat_id FROM jobs WHERE id=$1', [jobId]);
|
||||
if (jt?.origin === 'telegram' && jt.telegram_chat_id) {
|
||||
try {
|
||||
const { notifyJobDone } = await import('./lib/telegram');
|
||||
await notifyJobDone(Number(jt.telegram_chat_id), jobId);
|
||||
} catch (e) { console.error('[worker] Telegram-Notify:', e); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user