fix: refine telegram reactions (#964) (thanks @bohdanpodvirnyi)

This commit is contained in:
Peter Steinberger
2026-01-15 17:20:17 +00:00
parent f12c1b391f
commit 2b1c26f900
13 changed files with 157 additions and 28 deletions

View File

@@ -40,6 +40,7 @@ import {
type TelegramUpdateKeyContext,
} from "./bot-updates.js";
import { resolveTelegramFetch } from "./fetch.js";
import { wasSentByBot } from "./sent-message-cache.js";
export type TelegramBotOptions = {
token: string;
@@ -317,6 +318,8 @@ export function createTelegramBot(opts: TelegramBotOptions) {
// Resolve reaction notification mode (default: "off")
const reactionMode = telegramCfg.reactionNotifications ?? "off";
if (reactionMode === "off") return;
if (user?.is_bot) return;
if (reactionMode === "own" && !wasSentByBot(chatId, messageId)) return;
// Detect added reactions
const oldEmojis = new Set(