wip
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user