@dcrays/dcgchat 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.ts +2 -2
  2. package/package.json +1 -1
  3. package/src/bot.ts +4 -0
package/index.ts CHANGED
@@ -2,7 +2,7 @@ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
2
2
  import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
3
3
  import { dcgchatPlugin } from "./src/channel.js";
4
4
  import { setDcgchatRuntime, setWorkspaceDir } from "./src/runtime.js";
5
- // import { monitoringToolMessage } from "./src/tool.js";
5
+ import { monitoringToolMessage } from "./src/tool.js";
6
6
 
7
7
  const plugin = {
8
8
  id: "dcgchat",
@@ -11,7 +11,7 @@ const plugin = {
11
11
  configSchema: emptyPluginConfigSchema(),
12
12
  register(api: OpenClawPluginApi) {
13
13
  setDcgchatRuntime(api.runtime);
14
- // monitoringToolMessage(api);
14
+ monitoringToolMessage(api);
15
15
  api.registerChannel({ plugin: dcgchatPlugin });
16
16
  api.registerTool((ctx) => {
17
17
  const workspaceDir = ctx.workspaceDir;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcrays/dcgchat",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "type": "module",
5
5
  "description": "OpenClaw channel plugin for 书灵墨宝 (WebSocket)",
6
6
  "main": "index.ts",
package/src/bot.ts CHANGED
@@ -418,6 +418,10 @@ export async function handleDcgchatMessage(params: {
418
418
  const mediaUrl = mediaList[i];
419
419
  const key = getMediaKey(mediaUrl);
420
420
  if (sentMediaKeys.has(key)) continue;
421
+ if (!/^https?:\/\//i.test(mediaUrl) && !fs.existsSync(mediaUrl)) {
422
+ log(`dcgchat[${accountId}][deliver]: media file not found, skipping: ${mediaUrl}`);
423
+ continue;
424
+ }
421
425
  sentMediaKeys.add(key);
422
426
  await sendDcgchatMedia({
423
427
  cfg,