openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
26 lines (25 loc) • 1.09 kB
JavaScript
import { n as normalizeAccountId } from "./account-id-CETVCrTz.js";
import { n as resolveNormalizedAccountEntry } from "./account-lookup-CvFhSs3G.js";
import { t as mergeAccountConfig } from "./channel-account-config-BHCmOzi1.js";
import "./account-core-DA6N6mo1.js";
//#region extensions/telegram/src/account-config.ts
function resolveTelegramAccountConfig(cfg, accountId) {
const normalized = normalizeAccountId(accountId);
return resolveNormalizedAccountEntry(cfg.channels?.telegram?.accounts, normalized, normalizeAccountId);
}
function mergeTelegramAccountConfig(cfg, accountId) {
const channelConfig = cfg.channels?.telegram;
const isMultiAccount = Object.keys(channelConfig?.accounts ?? {}).length > 1;
return mergeAccountConfig({
channelConfig,
accountConfig: resolveTelegramAccountConfig(cfg, accountId),
omitKeys: ["defaultAccount"],
inheritEmptyKeys: {
capabilities: "array",
...isMultiAccount ? {} : { groups: "object" }
},
preserveRootAllowFrom: true
});
}
//#endregion
export { resolveTelegramAccountConfig as n, mergeTelegramAccountConfig as t };