Add Bun bundle docs and Telegram grammY support

This commit is contained in:
Peter Steinberger
2025-12-07 22:46:02 +01:00
parent 7b77e9f9ae
commit 4d3d9cca2a
16 changed files with 883 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
import { Bot } from "grammy";
export async function setTelegramWebhook(opts: {
token: string;
url: string;
secret?: string;
dropPendingUpdates?: boolean;
}) {
const bot = new Bot(opts.token);
await bot.api.setWebhook(opts.url, {
secret_token: opts.secret,
drop_pending_updates: opts.dropPendingUpdates ?? false,
});
}
export async function deleteTelegramWebhook(opts: { token: string }) {
const bot = new Bot(opts.token);
await bot.api.deleteWebhook();
}