fix(telegram): gate native fetch to bun

This commit is contained in:
Peter Steinberger committed 2026-01-08 08:26:40 +01:00
1 parent c1e97fab80
commit c241cb25bd
5 files changed
+27 -19

No files matched your search

+4 -4
View File
@@ -152,11 +152,11 @@ export function createTelegramBot(opts: TelegramBotOptions) {
},
};
const fetchImpl = resolveTelegramFetch(opts.proxyFetch);
const client: ApiClientOptions = {
fetch: fetchImpl as unknown as ApiClientOptions["fetch"],
};
const client: ApiClientOptions | undefined = fetchImpl
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
: undefined;
const bot = new Bot(opts.token, { client });
const bot = new Bot(opts.token, client ? { client } : undefined);
bot.api.config.use(apiThrottler());
bot.use(sequentialize(getTelegramSequentialKey));