fix: add hosted minimax onboarding (#495, thanks @tobiasbischoff)

This commit is contained in:
Peter Steinberger
2026-01-09 13:38:51 +01:00
parent 897685a2de
commit dc6f22c2c5
6 changed files with 527 additions and 149 deletions

View File

@@ -1,4 +1,4 @@
import { Bot, type ApiClientOptions } from "grammy";
import { type ApiClientOptions, Bot } from "grammy";
import { resolveTelegramFetch } from "./fetch.js";
export async function setTelegramWebhook(opts: {
@@ -11,10 +11,7 @@ export async function setTelegramWebhook(opts: {
const client: ApiClientOptions | undefined = fetchImpl
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
: undefined;
const bot = new Bot(
opts.token,
client ? { client } : undefined,
);
const bot = new Bot(opts.token, client ? { client } : undefined);
await bot.api.setWebhook(opts.url, {
secret_token: opts.secret,
drop_pending_updates: opts.dropPendingUpdates ?? false,
@@ -26,9 +23,6 @@ export async function deleteTelegramWebhook(opts: { token: string }) {
const client: ApiClientOptions | undefined = fetchImpl
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
: undefined;
const bot = new Bot(
opts.token,
client ? { client } : undefined,
);
const bot = new Bot(opts.token, client ? { client } : undefined);
await bot.api.deleteWebhook();
}