clawgram 2.6.0 → 2.6.1

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.
package/dist/channel.js CHANGED
@@ -1316,22 +1316,25 @@ const createChannelPlugin = (runtimes, pluginRuntime) => {
1316
1316
  removed: reactionParams.remove,
1317
1317
  });
1318
1318
  }
1319
+ // Core normalizes whichever of these it filled in to a local path (see
1320
+ // `mediaSourceParams` above); `mediaUrl` stays a URL, which GramJS
1321
+ // accepts as well.
1322
+ const attachedFile = (0, param_readers_1.readStringParam)(params, "filePath")
1323
+ ?? (0, param_readers_1.readStringParam)(params, "path")
1324
+ ?? (0, param_readers_1.readStringParam)(params, "media")
1325
+ ?? (0, param_readers_1.readStringParam)(params, "mediaUrl");
1319
1326
  // Core dispatches `upload-file`; `sendAttachment` is its legacy alias
1320
- // and arrives from older callers, so both land here.
1321
- if (action === "upload-file" || action === "sendAttachment") {
1327
+ // and arrives from older callers. A plain `send` carrying a file lands
1328
+ // here too `openclaw message send --media` does exactly that, and
1329
+ // routing it to the text path dropped the file without a word.
1330
+ if (action === "upload-file" || action === "sendAttachment" || (action === "send" && attachedFile)) {
1322
1331
  const rawUploadTo = (0, helpers_1.resolveActionTarget)(params, toolContext);
1323
1332
  const uploadTo = (0, helpers_1.normalizeOutboundTarget)(rawUploadTo);
1324
1333
  const uploadAccountId = resolveRuntimeAccountId(cfg, accountId);
1325
1334
  if (!uploadAccountId) {
1326
1335
  throw new Error("clawgram: no configured account found");
1327
1336
  }
1328
- // Core normalizes whichever of these it filled in to a local path
1329
- // (see `mediaSourceParams` above); `mediaUrl` stays a URL, which
1330
- // GramJS accepts as well.
1331
- const file = (0, param_readers_1.readStringParam)(params, "filePath")
1332
- ?? (0, param_readers_1.readStringParam)(params, "path")
1333
- ?? (0, param_readers_1.readStringParam)(params, "media")
1334
- ?? (0, param_readers_1.readStringParam)(params, "mediaUrl");
1337
+ const file = attachedFile;
1335
1338
  if (!file) {
1336
1339
  throw new Error("clawgram: upload-file requires filePath, path, media, or mediaUrl");
1337
1340
  }
@@ -2,7 +2,7 @@
2
2
  "id": "clawgram",
3
3
  "name": "Clawgram",
4
4
  "description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
5
- "version": "2.6.0",
5
+ "version": "2.6.1",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawgram",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {