import type { ChannelSetupAdapter } from "openclaw/plugin-sdk/setup-runtime"; import {
createEnvPatchedAccountSetupAdapter,
patchChannelConfigForAccount,
promptResolvedAllowFrom,
splitSetupEntries,
type OpenClawConfig,
type WizardPrompter,
} from "openclaw/plugin-sdk/setup-runtime"; import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools"; import { resolveDefaultTelegramAccountId, resolveTelegramAccount } from "./accounts.js"; import { isNumericTelegramSenderUserId } from "./allow-from.js";
const channel = "telegram" as const;
export const TELEGRAM_TOKEN_HELP_LINES = [ "1) Open Telegram and chat with @BotFather", "2) Run /newbot (or /mybots)", "3) Copy the token (looks like 123456:ABC...)", "Tip: you can also set TELEGRAM_BOT_TOKEN in your env.",
`Docs: ${formatDocsLink("/telegram")}`, "Website: https://openclaw.ai",
];
export const TELEGRAM_USER_ID_HELP_LINES = [
`1) DM your bot, then read from.id in \`${formatCliCommand("openclaw logs --follow")}\` (safest)`, "2) Or call https://api.telegram.org/bot<bot_token>/getUpdates and read message.from.id", "3) Third-party: DM @userinfobot or @getidsbot",
`Docs: ${formatDocsLink("/telegram")}`, "Website: https://openclaw.ai",
];
export function normalizeTelegramAllowFromInput(raw: string): string { return raw
.trim()
.replace(/^(telegram|tg):/i, "")
.trim();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.