UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

40 lines (39 loc) • 1.8 kB
import { c as normalizeOptionalLowercaseString, o as normalizeLowercaseStringOrEmpty } from "./string-coerce-CCIiB4H7.mjs"; import "./string-coerce-runtime-BwAZZDf5.mjs"; import { n as listTelegramAccountIds } from "./account-selection-CGYGB8bX.mjs"; import "./accounts-C26vVqsr.mjs"; import "./topic-conversation-CDf2PinB.mjs"; import { r as inspectTelegramAccount } from "./account-inspect-C24-1-jt.mjs"; //#region extensions/telegram/src/inline-buttons.ts const DEFAULT_INLINE_BUTTONS_SCOPE = "allowlist"; const INLINE_BUTTONS_SCOPES = [ "off", "dm", "group", "all", "allowlist" ]; function resolveTelegramInlineButtonsConfigScope(e) { if (!e || Array.isArray(e) || typeof e !== "object" || !("inlineButtons" in e)) return; const t = normalizeOptionalLowercaseString(e.inlineButtons); return INLINE_BUTTONS_SCOPES.find((e) => e === t); } function resolveTelegramInlineButtonsScopeFromCapabilities(e) { if (Array.isArray(e) && e.length > 0) return e.some((e) => normalizeLowercaseStringOrEmpty(String(e)) === "inlinebuttons") ? "all" : "off"; return resolveTelegramInlineButtonsConfigScope(e) ?? DEFAULT_INLINE_BUTTONS_SCOPE; } function resolveTelegramInlineButtonsScope(e) { return resolveTelegramInlineButtonsScopeFromCapabilities(inspectTelegramAccount({ cfg: e.cfg, accountId: e.accountId }).config.capabilities); } function isTelegramInlineButtonsEnabled(e) { const t = e.accountId ? [e.accountId] : listTelegramAccountIds(e.cfg); return (t.length > 0 ? t : [e.accountId]).some((t) => resolveTelegramInlineButtonsScope({ cfg: e.cfg, accountId: t }) !== "off"); } //#endregion export { resolveTelegramInlineButtonsScopeFromCapabilities as i, resolveTelegramInlineButtonsConfigScope as n, resolveTelegramInlineButtonsScope as r, isTelegramInlineButtonsEnabled as t };