import { startPolling } from "./poll"; import { startCommentNotifier } from "./notify"; import { TG_TOKEN } from "./config"; const g = globalThis as Record; export async function startBot(): Promise { if (g.__botStarted) return; g.__botStarted = true; if (!TG_TOKEN) { console.log("[bot] TG_BOT_TOKEN not configured, bot disabled"); return; } console.log("[bot] initializing..."); await startPolling(); startCommentNotifier(); } export { TG_TOKEN } from "./config"; export { sendMessage } from "./tg"; export { getSession, hasSession, clearSession } from "./sessions";