diff --git a/changes/feat-scheduled-actions.md b/changes/feat-scheduled-actions.md new file mode 100644 index 00000000..5e0986c3 --- /dev/null +++ b/changes/feat-scheduled-actions.md @@ -0,0 +1,10 @@ +### Added + +- **Cancel, edit and send now a scheduled message.** `tg personal messages scheduled cancel "Book club" 12` cancels + it, `tg personal messages scheduled edit "Book club" 12 "new text"` changes the text (add `--at-time 2h` to move + it too, or give only `--at-time` to move it), and `tg personal messages scheduled send "Book club" 12` sends it + right away. Before, `tg` could schedule and list, and the owner cancelled a post in the Telegram app. Telegram + numbers scheduled messages apart from sent ones: `messages edit` on a scheduled id failed with + `MESSAGE_ID_INVALID`, and `messages delete` with the same number would have deleted an old group message. The new + commands take only the ids `messages scheduled ` lists and check each against that list first. Cancelling + asks as a delete does at an `ask` level (`--allow-dangerous`). From cli-core with the scheduled actions. diff --git a/contracts/wirecat.json b/contracts/wirecat.json index 98727933..5793ece3 100644 --- a/contracts/wirecat.json +++ b/contracts/wirecat.json @@ -1303,7 +1303,7 @@ "messages", "scheduled" ], - "summary": "messages waiting to be sent later in a chat, soonest first; cancel one in…", + "summary": "messages waiting to be sent later in a chat, soonest first, with their…", "effects": { "remote": "read", "local": "read" @@ -1311,6 +1311,48 @@ "permission": "messages.scheduled", "entity": "message" }, + { + "path": [ + "messages", + "scheduled", + "cancel" + ], + "summary": "cancel scheduled messages before they are sent; they cannot be got back", + "effects": { + "remote": "write", + "local": "write" + }, + "permission": "messages.scheduled.cancel", + "entity": "scheduled_cancellation" + }, + { + "path": [ + "messages", + "scheduled", + "edit" + ], + "summary": "change the text or the time of a scheduled message before it is sent", + "effects": { + "remote": "write", + "local": "write" + }, + "permission": "messages.scheduled.edit", + "entity": "message_write" + }, + { + "path": [ + "messages", + "scheduled", + "send" + ], + "summary": "deliver what is scheduled right away instead of at its time; each gets a new id", + "effects": { + "remote": "write", + "local": "write" + }, + "permission": "messages.scheduled.send", + "entity": "scheduled_send" + }, { "path": [ "messages", @@ -7730,6 +7772,44 @@ "app": "tg-cli", "env": "TG" }, - "settings": null + "settings": null, + "accountRemove": { + "signOut": [ + "{profile}", + "session", + "end", + "--record", + "--json" + ], + "remove": { + "minVersion": "0.0.0", + "keepData": [ + "{profile}", + "account", + "remove", + "--keep-data", + "--record", + "--json" + ], + "deleteData": [ + "{profile}", + "account", + "remove", + "--delete-data", + "--record", + "--json" + ], + "dryRun": "--dry-run", + "confirm": "--yes" + }, + "removes": [ + "signIn" + ], + "keeps": [ + "settings", + "data", + "listed" + ] + } } } diff --git a/docs/commands.md b/docs/commands.md index ad9d6f83..f6a4e07f 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -2089,21 +2089,75 @@ tg messages press