fix: force telegram native fetch under bun
This commit is contained in:
8
src/telegram/fetch.ts
Normal file
8
src/telegram/fetch.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// BAN compatibility: force native fetch to avoid grammY's node-fetch shim under Bun.
|
||||
export function resolveTelegramFetch(proxyFetch?: typeof fetch): typeof fetch {
|
||||
const fetchImpl = proxyFetch ?? globalThis.fetch;
|
||||
if (!fetchImpl) {
|
||||
throw new Error("fetch is not available; set telegram.proxy in config");
|
||||
}
|
||||
return fetchImpl;
|
||||
}
|
||||
Reference in New Issue
Block a user