Files
openclaw/src/telegram/fetch.ts
2026-01-24 21:58:42 +00:00

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;
}