diff --git a/cli.js b/cli.js index 0aa633e..3a4d6f6 100755 --- a/cli.js +++ b/cli.js @@ -767,8 +767,10 @@ function normalizeOwnerArgs(name, args) { const normalized = structuredClone(args); const options = normalized.at(-1); if (options && typeof options === 'object') { - const inputField = name === 'send photo' ? 'photo' : name === 'send file' ? 'file' : null; - if (inputField && options[inputField]) options[inputField] = path.resolve(options[inputField]); + const inputFields = { 'send photo': ['photo'], 'send file': ['file'], 'send video': ['video', 'file'] }[name] ?? []; + for (const inputField of inputFields) { + if (options[inputField]) options[inputField] = path.resolve(options[inputField]); + } if (name === 'media download' && options.output) options.output = path.resolve(options.output); if (name === 'messages edit-caption') { for (const field of ['captionFile', 'expectedTextFile']) { @@ -807,7 +809,7 @@ function withGlobalOptions(handler) { globalFlags = getGlobalFlags(command); const name = commandPath(command); const actionArgs = args.slice(0, -1); - if (name === 'send text' || name === 'send file') { + if (name === 'send text' || name === 'send file' || name === 'send video') { validateSendParseMode(name, actionArgs.at(-1) ?? {}); } if (name === 'auth' || name === 'auth logout') { diff --git a/package-lock.json b/package-lock.json index 201634d..d4f35ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dapi/tgcli", - "version": "2.12.0", + "version": "2.12.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dapi/tgcli", - "version": "2.12.0", + "version": "2.12.1", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.27.1", diff --git a/package.json b/package.json index cf5a2ec..537fd4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dapi/tgcli", - "version": "2.12.0", + "version": "2.12.1", "type": "module", "description": "Telegram CLI + MCP server powered by MTProto and the official MCP SDK", "main": "mcp-server.js",