Telegram: enable grammY throttler and webhook tests

This commit is contained in:
Peter Steinberger
2025-12-07 22:52:57 +01:00
parent 4d3d9cca2a
commit 5f5846a08b
7 changed files with 120 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import { Buffer } from "node:buffer";
import { Bot, InputFile, webhookCallback } from "grammy";
import { apiThrottler } from "@grammyjs/transformer-throttler";
import type { ApiClientOptions } from "grammy";
import { chunkText } from "../auto-reply/chunk.js";
@@ -38,6 +39,7 @@ export function createTelegramBot(opts: TelegramBotOptions) {
: undefined;
const bot = new Bot(opts.token, { client });
bot.api.config.use(apiThrottler());
const cfg = loadConfig();
const requireMention =