mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-14 03:20:49 +00:00
12 lines
443 B
TypeScript
12 lines
443 B
TypeScript
import { resolveFetch } from "../infra/fetch.js";
|
|
|
|
// Prefer wrapped fetch when available to normalize AbortSignal across runtimes.
|
|
export function resolveTelegramFetch(proxyFetch?: typeof fetch): typeof fetch | undefined {
|
|
if (proxyFetch) return resolveFetch(proxyFetch);
|
|
const fetchImpl = resolveFetch();
|
|
if (!fetchImpl) {
|
|
throw new Error("fetch is not available; set channels.telegram.proxy in config");
|
|
}
|
|
return fetchImpl;
|
|
}
|