mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 17:50:20 +00:00
refactor: rename channel setup flow seam
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { type ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
patchChannelConfigForAccount,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import { type ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import { type ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import { hasConfiguredSecretInput } from "../../../src/config/types.secrets.js";
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
|
||||
const channel = "telegram" as const;
|
||||
|
||||
const dmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const dmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Telegram",
|
||||
channel,
|
||||
policyKey: "channels.telegram.dmPolicy",
|
||||
@@ -89,7 +89,7 @@ export const telegramSetupWizard: ChannelSetupWizard = {
|
||||
placeholder: "@username",
|
||||
invalidWithoutCredentialNote:
|
||||
"Telegram token missing; use numeric sender ids (usernames require a bot token).",
|
||||
parseInputs: splitOnboardingEntries,
|
||||
parseInputs: splitSetupEntries,
|
||||
parseId: parseTelegramAllowFromId,
|
||||
resolveEntries: async ({ credentialValues, entries }) =>
|
||||
resolveTelegramAllowFromEntries({
|
||||
@@ -105,7 +105,7 @@ export const telegramSetupWizard: ChannelSetupWizard = {
|
||||
}),
|
||||
},
|
||||
dmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
export { parseTelegramAllowFromId, telegramSetupAdapter };
|
||||
|
||||
Reference in New Issue
Block a user