diegosouzapw/OmniRoute · error

TELEGRAM_BOT_TOKEN is not set

Error message

TELEGRAM_BOT_TOKEN is not set

What it means

Error "TELEGRAM_BOT_TOKEN is not set" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/telegram/botApi.ts:54

  from?: TelegramUser;
}

export interface TelegramUpdate {
  update_id: number;
  message?: TelegramMessage;
  // Mini App payloads arrive as callback_query or message.web_app_data;
  // the common shape is message.text (commands) — start with those.
  callback_query?: {
    id: string;
    from: TelegramUser;
    message?: TelegramMessage;
    data?: string;
  };
}

async function botFetch<T>(method: string, body: unknown): Promise<T> {
  const token = getTelegramBotToken();
  if (!token) throw new Error("TELEGRAM_BOT_TOKEN is not set");
  const url = `${getTelegramBotApiBase()}/bot${token}/${method}`;
  const res = await fetch(url, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(body),
    signal: AbortSignal.timeout(getTelegramWebhookTimeoutMs()),
  });
  const json = (await res.json().catch(() => null)) as {
    ok?: boolean;
    description?: string;
    result?: T;
  } | null;
  if (!res.ok || !json?.ok) {
    throw new Error(`Telegram API ${method} failed: ${json?.description || res.status}`);
  }
  return json.result as T;
}

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/telegram/botApi.ts:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/9d3a7b2a5daab4c0. Report an issue: GitHub.