{"record":{"id":"9d3a7b2a5daab4c0","repo":"diegosouzapw/OmniRoute","slug":"telegram-bot-token-is-not-set","errorCode":null,"errorMessage":"TELEGRAM_BOT_TOKEN is not set","messagePattern":"TELEGRAM_BOT_TOKEN is not set","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/telegram/botApi.ts","lineNumber":54,"sourceCode":"  from?: TelegramUser;\n}\n\nexport interface TelegramUpdate {\n  update_id: number;\n  message?: TelegramMessage;\n  // Mini App payloads arrive as callback_query or message.web_app_data;\n  // the common shape is message.text (commands) — start with those.\n  callback_query?: {\n    id: string;\n    from: TelegramUser;\n    message?: TelegramMessage;\n    data?: string;\n  };\n}\n\nasync function botFetch<T>(method: string, body: unknown): Promise<T> {\n  const token = getTelegramBotToken();\n  if (!token) throw new Error(\"TELEGRAM_BOT_TOKEN is not set\");\n  const url = `${getTelegramBotApiBase()}/bot${token}/${method}`;\n  const res = await fetch(url, {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify(body),\n    signal: AbortSignal.timeout(getTelegramWebhookTimeoutMs()),\n  });\n  const json = (await res.json().catch(() => null)) as {\n    ok?: boolean;\n    description?: string;\n    result?: T;\n  } | null;\n  if (!res.ok || !json?.ok) {\n    throw new Error(`Telegram API ${method} failed: ${json?.description || res.status}`);\n  }\n  return json.result as T;\n}\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/telegram/botApi.ts#L36-L72","documentation":"Error \"TELEGRAM_BOT_TOKEN is not set\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/telegram/botApi.ts:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}