Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading