tgutil
Edit and delete Telegram messages from the command line
TLDR
SYNOPSIS
tgutil -n session -u chat -m mode --text text [--newtext text]
DESCRIPTION
tgutil is a CLI tool for editing and deleting messages in Telegram chats. It is part of the telegram-cloud Python package, which provides a suite of tools for interacting with Telegram from the command line.The tool operates in four modes: `edit` modifies the first matching message, `editall` modifies all matching messages, `delete` removes the first matching message, and `deleteall` removes all matching messages containing the specified text.Install via pip: `pip install telegram-cloud`.
PARAMETERS
-n, --name SESSION
Session name (authenticated Telegram account).-u, --username CHAT
Target chat ID or username. Use `me` for Saved Messages.-m, --mode MODE
Operation mode: `edit`, `editall`, `delete`, `deleteall`.--text TEXT
Text to search for in messages.--newtext TEXT
Replacement text (required for `edit` and `editall` modes).
CAVEATS
Requires prior authentication via tglogin with a Telegram API id and hash from https://my.telegram.org. Part of the telegram-cloud package. Can only edit or delete your own messages.
