From c463b13ef77e597de27bf1203638984463affc56 Mon Sep 17 00:00:00 2001 From: Muhammed Mukhthar CM Date: Fri, 30 Jan 2026 13:58:32 +0000 Subject: [PATCH] telegram-user: rebrand plugin to openclaw --- docs/channels/telegram-user.md | 14 ++++++------- extensions/telegram-user/index.ts | 6 +++--- ...wdbot.plugin.json => openclaw.plugin.json} | 0 extensions/telegram-user/package.json | 14 ++++++------- extensions/telegram-user/src/accounts.ts | 2 +- extensions/telegram-user/src/active-client.ts | 2 +- extensions/telegram-user/src/channel.test.ts | 8 ++++---- extensions/telegram-user/src/channel.ts | 10 +++++----- extensions/telegram-user/src/client.ts | 8 ++++---- extensions/telegram-user/src/config-schema.ts | 2 +- .../telegram-user/src/directory-config.ts | 4 ++-- extensions/telegram-user/src/login.ts | 2 +- .../telegram-user/src/monitor/handler.ts | 4 ++-- extensions/telegram-user/src/monitor/index.ts | 4 ++-- extensions/telegram-user/src/onboarding.ts | 20 +++++++++---------- extensions/telegram-user/src/runtime.ts | 2 +- extensions/telegram-user/src/send.ts | 4 ++-- extensions/telegram-user/src/session.ts | 2 +- extensions/telegram-user/src/types.ts | 2 +- pnpm-lock.yaml | 2 +- 20 files changed, 56 insertions(+), 56 deletions(-) rename extensions/telegram-user/{clawdbot.plugin.json => openclaw.plugin.json} (100%) diff --git a/docs/channels/telegram-user.md b/docs/channels/telegram-user.md index ff058ff43..02678951c 100644 --- a/docs/channels/telegram-user.md +++ b/docs/channels/telegram-user.md @@ -3,7 +3,7 @@ summary: "Connect a Telegram user account via MTProto (DMs + groups)" --- # Telegram User -Telegram User connects Moltbot to a **personal Telegram account** using MTProto. +Telegram User connects OpenClaw to a **personal Telegram account** using MTProto. Use this when you need user-level DMs or want to message from your own account in groups. ## Requirements @@ -16,7 +16,7 @@ Use this when you need user-level DMs or want to message from your own account i If the plugin is not bundled, install it: ```bash -moltbot plugins install @moltbot/telegram-user +openclaw plugins install @openclaw/telegram-user ``` ## Configure @@ -27,25 +27,25 @@ Option A: env vars (default account only) ```bash export TELEGRAM_USER_API_ID="123456" export TELEGRAM_USER_API_HASH="your_api_hash" -moltbot channels add --channel telegram-user --use-env +openclaw channels add --channel telegram-user --use-env ``` Option B: config ```bash -moltbot channels add --channel telegram-user --api-id 123456 --api-hash your_api_hash +openclaw channels add --channel telegram-user --api-id 123456 --api-hash your_api_hash ``` ## Login (QR or phone code) QR login (default): ```bash -moltbot channels login --channel telegram-user +openclaw channels login --channel telegram-user ``` Phone login: ```bash export TELEGRAM_USER_PHONE="+15551234567" -moltbot channels login --channel telegram-user +openclaw channels login --channel telegram-user ``` Optional env helpers: @@ -57,7 +57,7 @@ Optional env helpers: By default, DMs are protected with pairing. Approve requests with: ```bash -moltbot pairing approve telegram-user +openclaw pairing approve telegram-user ``` See [Pairing](/start/pairing) for details. diff --git a/extensions/telegram-user/index.ts b/extensions/telegram-user/index.ts index 6bb1142df..8d8ac04d7 100644 --- a/extensions/telegram-user/index.ts +++ b/extensions/telegram-user/index.ts @@ -1,5 +1,5 @@ -import type { MoltbotPluginApi } from "clawdbot/plugin-sdk"; -import { emptyPluginConfigSchema } from "clawdbot/plugin-sdk"; +import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import { emptyPluginConfigSchema } from "openclaw/plugin-sdk"; import { telegramUserPlugin } from "./src/channel.js"; import { setTelegramUserRuntime } from "./src/runtime.js"; @@ -9,7 +9,7 @@ const plugin = { name: "Telegram User", description: "Telegram MTProto user channel plugin", configSchema: emptyPluginConfigSchema(), - register(api: MoltbotPluginApi) { + register(api: OpenClawPluginApi) { setTelegramUserRuntime(api.runtime); api.registerChannel({ plugin: telegramUserPlugin }); }, diff --git a/extensions/telegram-user/clawdbot.plugin.json b/extensions/telegram-user/openclaw.plugin.json similarity index 100% rename from extensions/telegram-user/clawdbot.plugin.json rename to extensions/telegram-user/openclaw.plugin.json diff --git a/extensions/telegram-user/package.json b/extensions/telegram-user/package.json index c312860cb..903286ee4 100644 --- a/extensions/telegram-user/package.json +++ b/extensions/telegram-user/package.json @@ -1,9 +1,9 @@ { - "name": "@moltbot/telegram-user", - "version": "2026.1.22", + "name": "@openclaw/telegram-user", + "version": "2026.1.29", "type": "module", - "description": "Moltbot Telegram user (MTProto) channel plugin", - "moltbot": { + "description": "OpenClaw Telegram user (MTProto) channel plugin", + "openclaw": { "extensions": [ "./index.ts" ], @@ -19,7 +19,7 @@ "quickstartAllowFrom": true }, "install": { - "npmSpec": "@moltbot/telegram-user", + "npmSpec": "@openclaw/telegram-user", "localPath": "extensions/telegram-user", "defaultChoice": "npm" } @@ -33,9 +33,9 @@ "zod": "^4.3.6" }, "devDependencies": { - "moltbot": "workspace:*" + "openclaw": "workspace:*" }, "peerDependencies": { - "moltbot": ">=2026.1.25" + "openclaw": ">=2026.1.29" } } diff --git a/extensions/telegram-user/src/accounts.ts b/extensions/telegram-user/src/accounts.ts index 6754a1052..2f6a29ac3 100644 --- a/extensions/telegram-user/src/accounts.ts +++ b/extensions/telegram-user/src/accounts.ts @@ -1,5 +1,5 @@ import type { CoreConfig, TelegramUserAccountConfig } from "./types.js"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "clawdbot/plugin-sdk"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk"; export type TelegramUserCredentials = { apiId?: number; diff --git a/extensions/telegram-user/src/active-client.ts b/extensions/telegram-user/src/active-client.ts index 9d28de517..d6639ab71 100644 --- a/extensions/telegram-user/src/active-client.ts +++ b/extensions/telegram-user/src/active-client.ts @@ -1,5 +1,5 @@ import type { TelegramClient } from "@mtcute/node"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "clawdbot/plugin-sdk"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk"; const activeClients = new Map(); diff --git a/extensions/telegram-user/src/channel.test.ts b/extensions/telegram-user/src/channel.test.ts index 00c7fd3b4..dc3161a36 100644 --- a/extensions/telegram-user/src/channel.test.ts +++ b/extensions/telegram-user/src/channel.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import type { MoltbotConfig, RuntimeEnv } from "clawdbot/plugin-sdk"; +import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk"; const sendMediaTelegramUser = vi.fn< typeof import("./send.js").sendMediaTelegramUser @@ -37,7 +37,7 @@ describe("telegram-user channel plugin", () => { mediaMaxMb: 7, }, }, - } satisfies Partial as unknown as MoltbotConfig; + } satisfies Partial as unknown as OpenClawConfig; const mod = await import("./channel.js"); await mod.telegramUserPlugin.outbound?.sendMedia?.({ @@ -60,7 +60,7 @@ describe("telegram-user channel plugin", () => { channels: { "telegram-user": {}, }, - } satisfies Partial as unknown as MoltbotConfig; + } satisfies Partial as unknown as OpenClawConfig; const mod = await import("./channel.js"); await mod.telegramUserPlugin.outbound?.sendMedia?.({ @@ -88,7 +88,7 @@ describe("telegram-user channel plugin", () => { }, }, }, - } satisfies Partial as unknown as MoltbotConfig; + } satisfies Partial as unknown as OpenClawConfig; const mod = await import("./channel.js"); const runtime = { diff --git a/extensions/telegram-user/src/channel.ts b/extensions/telegram-user/src/channel.ts index 372906a4d..ffd9fe1fc 100644 --- a/extensions/telegram-user/src/channel.ts +++ b/extensions/telegram-user/src/channel.ts @@ -13,9 +13,9 @@ import { type ChannelGroupContext, type ChannelPlugin, type ChannelSetupInput, - type MoltbotConfig, + type OpenClawConfig, type GroupToolPolicyConfig, -} from "clawdbot/plugin-sdk"; +} from "openclaw/plugin-sdk"; import { listTelegramUserAccountIds, @@ -338,7 +338,7 @@ export const telegramUserPlugin: ChannelPlugin = { resolveAccountId: ({ accountId }) => normalizeAccountId(accountId), applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({ - cfg: cfg as MoltbotConfig, + cfg: cfg as OpenClawConfig, channelKey: "telegram-user", accountId, name, @@ -356,7 +356,7 @@ export const telegramUserPlugin: ChannelPlugin = { applyAccountConfig: ({ cfg, accountId, input }) => { const setupInput = input as TelegramUserSetupInput; const namedConfig = applyAccountNameToChannelSection({ - cfg: cfg as MoltbotConfig, + cfg: cfg as OpenClawConfig, channelKey: "telegram-user", accountId, name: setupInput.name, @@ -454,7 +454,7 @@ export const telegramUserPlugin: ChannelPlugin = { } } - const nextCfg = { ...cfg } as MoltbotConfig; + const nextCfg = { ...cfg } as OpenClawConfig; const nextSection = cfg.channels?.["telegram-user"] ? { ...cfg.channels["telegram-user"] } : undefined; diff --git a/extensions/telegram-user/src/client.ts b/extensions/telegram-user/src/client.ts index 708541e1b..bce7e3b4f 100644 --- a/extensions/telegram-user/src/client.ts +++ b/extensions/telegram-user/src/client.ts @@ -17,10 +17,10 @@ export async function createTelegramUserClient(params: { // the "import" condition (ESM), eliminating the warning. const { BaseTelegramClient, TelegramClient, NodePlatform } = await loadMtcuteNode(); - class MoltbotTelegramUserPlatform extends NodePlatform { + class OpenClawTelegramUserPlatform extends NodePlatform { // mtcute's default NodePlatform.beforeExit installs SIGINT/SIGTERM handlers that re-send the - // signal, which can race with Moltbot's graceful shutdown and close sqlite while writes are - // pending. We only hook into process exit events (no signal handlers) and rely on Moltbot to + // signal, which can race with OpenClaw's graceful shutdown and close sqlite while writes are + // pending. We only hook into process exit events (no signal handlers) and rely on OpenClaw to // stop cleanly. override beforeExit(fn: () => void): () => void { const onBeforeExit = () => fn(); @@ -38,7 +38,7 @@ export async function createTelegramUserClient(params: { apiId: params.apiId, apiHash: params.apiHash, storage: params.storagePath, - platform: new MoltbotTelegramUserPlatform(), + platform: new OpenClawTelegramUserPlatform(), }); return new TelegramClient({ client }); } diff --git a/extensions/telegram-user/src/config-schema.ts b/extensions/telegram-user/src/config-schema.ts index 0f42c0762..a844abae5 100644 --- a/extensions/telegram-user/src/config-schema.ts +++ b/extensions/telegram-user/src/config-schema.ts @@ -5,7 +5,7 @@ import { GroupPolicySchema, ToolPolicySchema, requireOpenAllowFrom, -} from "clawdbot/plugin-sdk"; +} from "openclaw/plugin-sdk"; const allowFromEntry = z.union([z.string(), z.number()]); diff --git a/extensions/telegram-user/src/directory-config.ts b/extensions/telegram-user/src/directory-config.ts index e252df6f1..182b7618f 100644 --- a/extensions/telegram-user/src/directory-config.ts +++ b/extensions/telegram-user/src/directory-config.ts @@ -1,10 +1,10 @@ -import type { ChannelDirectoryEntry, MoltbotConfig } from "clawdbot/plugin-sdk"; +import type { ChannelDirectoryEntry, OpenClawConfig } from "openclaw/plugin-sdk"; import { resolveTelegramUserAccount } from "./accounts.js"; import type { CoreConfig } from "./types.js"; export type TelegramUserDirectoryConfigParams = { - cfg: MoltbotConfig; + cfg: OpenClawConfig; accountId?: string | null; query?: string | null; limit?: number | null; diff --git a/extensions/telegram-user/src/login.ts b/extensions/telegram-user/src/login.ts index 1ba88c9de..778a56cf9 100644 --- a/extensions/telegram-user/src/login.ts +++ b/extensions/telegram-user/src/login.ts @@ -2,7 +2,7 @@ import qrcode from "qrcode-terminal"; import { createInterface } from "node:readline/promises"; import { stdin as input, stdout as output } from "node:process"; import { isCancel, select } from "@clack/prompts"; -import type { RuntimeEnv } from "clawdbot/plugin-sdk"; +import type { RuntimeEnv } from "openclaw/plugin-sdk"; import { createTelegramUserClient } from "./client.js"; import { ensureTelegramUserSessionDir } from "./session.js"; diff --git a/extensions/telegram-user/src/monitor/handler.ts b/extensions/telegram-user/src/monitor/handler.ts index 56aa3d5ed..1c2545d97 100644 --- a/extensions/telegram-user/src/monitor/handler.ts +++ b/extensions/telegram-user/src/monitor/handler.ts @@ -1,6 +1,6 @@ import type { TelegramClient } from "@mtcute/node"; import type { MessageContext } from "@mtcute/dispatcher"; -import type { RuntimeEnv } from "clawdbot/plugin-sdk"; +import type { RuntimeEnv } from "openclaw/plugin-sdk"; import { formatLocationText, @@ -8,7 +8,7 @@ import { resolveMentionGatingWithBypass, toLocationContext, type NormalizedLocation, -} from "clawdbot/plugin-sdk"; +} from "openclaw/plugin-sdk"; import { getTelegramUserRuntime } from "../runtime.js"; import type { CoreConfig, TelegramUserAccountConfig } from "../types.js"; import { sendMediaTelegramUser, sendMessageTelegramUser } from "../send.js"; diff --git a/extensions/telegram-user/src/monitor/index.ts b/extensions/telegram-user/src/monitor/index.ts index bc334018a..4e3b2a5c3 100644 --- a/extensions/telegram-user/src/monitor/index.ts +++ b/extensions/telegram-user/src/monitor/index.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import type { RuntimeEnv } from "clawdbot/plugin-sdk"; +import type { RuntimeEnv } from "openclaw/plugin-sdk"; import { createTelegramUserClient } from "../client.js"; import { resolveTelegramUserAccount } from "../accounts.js"; @@ -60,7 +60,7 @@ export async function monitorTelegramUserProvider(opts: MonitorTelegramUserOpts const storagePath = resolveTelegramUserSessionPath(account.accountId); if (!fs.existsSync(storagePath)) { throw new Error( - "Telegram user session missing. Run `moltbot channels login --channel telegram-user` first.", + "Telegram user session missing. Run `openclaw channels login --channel telegram-user` first.", ); } const client = await createTelegramUserClient({ apiId, apiHash, storagePath }); diff --git a/extensions/telegram-user/src/onboarding.ts b/extensions/telegram-user/src/onboarding.ts index 0c9f0933a..923ea709f 100644 --- a/extensions/telegram-user/src/onboarding.ts +++ b/extensions/telegram-user/src/onboarding.ts @@ -6,10 +6,10 @@ import { normalizeAccountId, type ChannelOnboardingAdapter, type ChannelOnboardingDmPolicy, - type MoltbotConfig, + type OpenClawConfig, type DmPolicy, type WizardPrompter, -} from "clawdbot/plugin-sdk"; +} from "openclaw/plugin-sdk"; import { listTelegramUserAccountIds, @@ -24,10 +24,10 @@ const channel = "telegram-user" as const; type TelegramUserChannelConfig = NonNullable["telegram-user"]; function setTelegramUserDmPolicy( - cfg: MoltbotConfig, + cfg: OpenClawConfig, policy: DmPolicy, accountId?: string, -): MoltbotConfig { +): OpenClawConfig { const resolvedAccountId = normalizeAccountId(accountId) ?? DEFAULT_ACCOUNT_ID; const current = cfg.channels?.["telegram-user"] as TelegramUserChannelConfig | undefined; const allowFrom = @@ -73,7 +73,7 @@ async function noteTelegramUserAuthHelp(prompter: WizardPrompter): Promise [ "Telegram User (MTProto) needs an API ID + API hash from my.telegram.org.", "You can store them in config or set TELEGRAM_USER_API_ID/TELEGRAM_USER_API_HASH.", - "Login happens via `moltbot channels login --channel telegram-user`.", + "Login happens via `openclaw channels login --channel telegram-user`.", `Docs: ${formatDocsLink("/channels/telegram-user", "channels/telegram-user")}`, ].join("\n"), "Telegram user setup", @@ -94,10 +94,10 @@ function parseAllowFromInput(raw: string): string[] { } async function promptTelegramUserAllowFrom(params: { - cfg: MoltbotConfig; + cfg: OpenClawConfig; prompter: WizardPrompter; accountId?: string; -}): Promise { +}): Promise { const accountId = normalizeAccountId(params.accountId) ?? DEFAULT_ACCOUNT_ID; const resolved = resolveTelegramUserAccount({ cfg: params.cfg as CoreConfig, @@ -197,7 +197,7 @@ export const telegramUserOnboardingAdapter: ChannelOnboardingAdapter = { let accountId = override ? normalizeAccountId(override) : defaultAccountId; if (shouldPromptAccountIds && !override) { accountId = await promptAccountId({ - cfg: cfg as MoltbotConfig, + cfg: cfg as OpenClawConfig, prompter, label: "Telegram User", currentId: accountId ?? defaultAccountId, @@ -344,7 +344,7 @@ export const telegramUserOnboardingAdapter: ChannelOnboardingAdapter = { } catch (err) { runtime.error(`Telegram user login failed: ${String(err)}`); await prompter.note( - `Run \`moltbot channels login --channel telegram-user\` later to link.`, + `Run \`openclaw channels login --channel telegram-user\` later to link.`, "Telegram user login", ); } @@ -353,7 +353,7 @@ export const telegramUserOnboardingAdapter: ChannelOnboardingAdapter = { await prompter.note( [ "Next: link the account via QR or phone code.", - "Run: moltbot channels login --channel telegram-user", + "Run: openclaw channels login --channel telegram-user", ].join("\n"), "Telegram user login", ); diff --git a/extensions/telegram-user/src/runtime.ts b/extensions/telegram-user/src/runtime.ts index 464387f19..54b4733a0 100644 --- a/extensions/telegram-user/src/runtime.ts +++ b/extensions/telegram-user/src/runtime.ts @@ -1,4 +1,4 @@ -import type { PluginRuntime } from "clawdbot/plugin-sdk"; +import type { PluginRuntime } from "openclaw/plugin-sdk"; let runtime: PluginRuntime | null = null; diff --git a/extensions/telegram-user/src/send.ts b/extensions/telegram-user/src/send.ts index 13e6558eb..126b88bc1 100644 --- a/extensions/telegram-user/src/send.ts +++ b/extensions/telegram-user/src/send.ts @@ -1,6 +1,6 @@ import fs from "node:fs"; import type { TelegramClient } from "@mtcute/node"; -import type { PollInput } from "clawdbot/plugin-sdk"; +import type { PollInput } from "openclaw/plugin-sdk"; import { getTelegramUserRuntime } from "./runtime.js"; import { resolveTelegramUserAccount } from "./accounts.js"; @@ -156,7 +156,7 @@ async function resolveClient(params: { const storagePath = resolveTelegramUserSessionPath(account.accountId); if (!fs.existsSync(storagePath)) { throw new Error( - "Telegram user session missing. Run `moltbot channels login --channel telegram-user` first.", + "Telegram user session missing. Run `openclaw channels login --channel telegram-user` first.", ); } const client = await createTelegramUserClient({ apiId, apiHash, storagePath }); diff --git a/extensions/telegram-user/src/session.ts b/extensions/telegram-user/src/session.ts index 23874658c..6761cf917 100644 --- a/extensions/telegram-user/src/session.ts +++ b/extensions/telegram-user/src/session.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import path from "node:path"; -import { normalizeAccountId } from "clawdbot/plugin-sdk"; +import { normalizeAccountId } from "openclaw/plugin-sdk"; import { getTelegramUserRuntime } from "./runtime.js"; export function resolveTelegramUserSessionPath(accountId?: string | null): string { diff --git a/extensions/telegram-user/src/types.ts b/extensions/telegram-user/src/types.ts index 59a6e32a9..1d6d6953a 100644 --- a/extensions/telegram-user/src/types.ts +++ b/extensions/telegram-user/src/types.ts @@ -1,4 +1,4 @@ -import type { DmPolicy, GroupPolicy, GroupToolPolicyConfig } from "clawdbot/plugin-sdk"; +import type { DmPolicy, GroupPolicy, GroupToolPolicyConfig } from "openclaw/plugin-sdk"; export type TelegramUserTopicConfig = { requireMention?: boolean; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 47acbe8f9..ebe17aee5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -436,7 +436,7 @@ importers: specifier: ^4.3.6 version: 4.3.6 devDependencies: - clawdbot: + openclaw: specifier: workspace:* version: link:../..