From 3db0311b2f7ec7fa4bb53de25c18368dca53bbd1 Mon Sep 17 00:00:00 2001 From: "feifei.xu" <307327147@qq.com> Date: Sun, 15 Mar 2026 12:24:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80=20pluginId=20?= =?UTF-8?q?=E4=B8=BA=20zhidui-channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 package.json pluginId: pit-bot -> zhidui-channel - 修改 channel.ts 中的 id 为 zhidui-channel - 重命名目录为 openclaw-zhidui-channel --- src/channel.ts | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/channel.ts b/src/channel.ts index bf4a958..f353a9b 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -1,6 +1,5 @@ /** - * PIT Channel 主文件 - * @module channel + * PIT Channel 主文? * @module channel */ import type { @@ -33,7 +32,7 @@ import { chunkText } from "./utils/chunker.js"; import { createLogger } from "./utils/logger.js"; import { registerWebUIRoutes } from "./webui/routes.js"; -const MODULE = "pit-bot"; +const MODULE = "zhidui-channel"; // Gateway 实例映射 const gateways = new Map(); @@ -42,10 +41,10 @@ const gateways = new Map(); * PIT Bot Channel Plugin */ export const pitBotPlugin: ChannelPlugin = { - id: "pit-bot", + id: "zhidui-channel", meta: { - id: "pit-bot", + id: "zhidui-channel", label: "PIT Bot", selectionLabel: "PIT Bot", docsPath: "/docs/channels/pit-bot", @@ -121,7 +120,7 @@ export const pitBotPlugin: ChannelPlugin = { const gateway = gateways.get(accountId); if (!gateway) { return { - channel: "pit-bot", + channel: "zhidui-channel", messageId: "", error: new Error(`Gateway not available for account ${accountId}`), }; @@ -130,7 +129,7 @@ export const pitBotPlugin: ChannelPlugin = { const result = await gateway.sendText(to, text, replyToId); return { - channel: "pit-bot", + channel: "zhidui-channel", messageId: result.messageId ?? "", error: result.error ? new Error(result.error) : undefined, }; @@ -138,7 +137,7 @@ export const pitBotPlugin: ChannelPlugin = { const message = error instanceof Error ? error.message : String(error); log.error("sendText failed", { to, accountId, error: message }); return { - channel: "pit-bot", + channel: "zhidui-channel", messageId: "", error: new Error(message), }; @@ -152,7 +151,7 @@ export const pitBotPlugin: ChannelPlugin = { const gateway = gateways.get(accountId); if (!gateway) { return { - channel: "pit-bot", + channel: "zhidui-channel", messageId: "", error: new Error(`Gateway not available for account ${accountId}`), }; @@ -161,7 +160,7 @@ export const pitBotPlugin: ChannelPlugin = { const result = await gateway.sendMedia(to, mediaUrl ?? "", text, replyToId); return { - channel: "pit-bot", + channel: "zhidui-channel", messageId: result.messageId ?? "", error: result.error ? new Error(result.error) : undefined, }; @@ -169,7 +168,7 @@ export const pitBotPlugin: ChannelPlugin = { const message = error instanceof Error ? error.message : String(error); log.error("sendMedia failed", { to, accountId, error: message }); return { - channel: "pit-bot", + channel: "zhidui-channel", messageId: "", error: new Error(message), }; @@ -205,7 +204,7 @@ export const pitBotPlugin: ChannelPlugin = { getStatus: () => ctx.getStatus(), onMessage: (message: PITUserMessage) => { ctx.emitMessage({ - channel: "pit-bot", + channel: "zhidui-channel", accountId: account.accountId, chatId: `pit-bot:user:${message.userId}`, chatType: "direct", @@ -310,8 +309,7 @@ export const pitBotPlugin: ChannelPlugin = { }, } as ChannelStatusAdapter, - // 初始化钩子 - init: async (api: unknown) => { + // 初始化钩? init: async (api: unknown) => { const log = createLogger(MODULE); log.info("PIT Bot plugin initializing");