fix(telegram): gate native fetch to bun
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user