refactor: use shared pairing store for telegram

This commit is contained in:
Ayaan Zaidi
2026-02-01 14:55:41 +05:30
committed by Ayaan Zaidi
parent ca92597e1f
commit 24fbafa9a7
23 changed files with 95 additions and 288 deletions

View File

@@ -31,6 +31,7 @@ import {
} from "../config/telegram-custom-commands.js";
import { danger, logVerbose } from "../globals.js";
import { getChildLogger } from "../logging.js";
import { readChannelAllowFromStore } from "../pairing/pairing-store.js";
import {
executePluginCommand,
getPluginCommandSpecs,
@@ -49,7 +50,6 @@ import {
buildTelegramGroupPeerId,
resolveTelegramForumThreadId,
} from "./bot/helpers.js";
import { readTelegramAllowFromStore } from "./pairing-store.js";
import { buildInlineKeyboard } from "./send.js";
const EMPTY_RESPONSE_FALLBACK = "No response generated. Please try again.";
@@ -153,7 +153,7 @@ async function resolveTelegramCommandAuth(params: {
isForum,
messageThreadId,
});
const storeAllowFrom = await readTelegramAllowFromStore().catch(() => []);
const storeAllowFrom = await readChannelAllowFromStore("telegram").catch(() => []);
const { groupConfig, topicConfig } = resolveTelegramGroupConfig(chatId, resolvedThreadId);
const groupAllowOverride = firstDefined(topicConfig?.allowFrom, groupConfig?.allowFrom);
const effectiveGroupAllow = normalizeAllowFromWithStore({