This commit is contained in:
Onur authored and Peter Steinberger committed 2026-01-09 11:06:49 +01:00
1 parent d6256a388e
commit 2ab5890eab
2 files changed
+35 -1

No files matched your search

+5 -1
View File
@@ -153,8 +153,12 @@ export function createTelegramBot(opts: TelegramBotOptions) {
},
};
const fetchImpl = resolveTelegramFetch(opts.proxyFetch);
const isBun = "Bun" in globalThis || Boolean(process?.versions?.bun);
const shouldProvideFetch = Boolean(opts.proxyFetch) || isBun;
const client: ApiClientOptions | undefined = fetchImpl
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
? shouldProvideFetch
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
: undefined
: undefined;
const bot = new Bot(opts.token, client ? { client } : undefined);