fix: normalize telegram fetch for long-polling

This commit is contained in:
Peter Steinberger
2026-01-24 21:58:42 +00:00
parent 30534c5c33
commit ac00065727
6 changed files with 24 additions and 94 deletions

View File

@@ -117,8 +117,7 @@ export function createTelegramBot(opts: TelegramBotOptions) {
const telegramCfg = account.config;
const fetchImpl = resolveTelegramFetch(opts.proxyFetch);
const isBun = "Bun" in globalThis || Boolean(process?.versions?.bun);
const shouldProvideFetch = Boolean(opts.proxyFetch) || isBun;
const shouldProvideFetch = Boolean(fetchImpl);
const timeoutSeconds =
typeof telegramCfg?.timeoutSeconds === "number" && Number.isFinite(telegramCfg.timeoutSeconds)
? Math.max(1, Math.floor(telegramCfg.timeoutSeconds))