{"id":16294767,"url":"https://github.com/finesse/telegramdeletions","last_synced_at":"2025-06-17T14:36:03.346Z","repository":{"id":236473953,"uuid":"792629077","full_name":"Finesse/TelegramDeletions","owner":"Finesse","description":"A CLI script to save messages deleted from a Telegram chat","archived":false,"fork":false,"pushed_at":"2024-10-24T05:17:59.000Z","size":11,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T19:35:42.768Z","etag":null,"topics":["cli","recovery","service","surveillance","telegram"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Finesse.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-27T05:36:53.000Z","updated_at":"2025-03-19T15:05:34.000Z","dependencies_parsed_at":"2024-11-05T16:56:02.969Z","dependency_job_id":null,"html_url":"https://github.com/Finesse/TelegramDeletions","commit_stats":null,"previous_names":["finesse/telegramdeletions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Finesse/TelegramDeletions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2FTelegramDeletions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2FTelegramDeletions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2FTelegramDeletions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2FTelegramDeletions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Finesse","download_url":"https://codeload.github.com/Finesse/TelegramDeletions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finesse%2FTelegramDeletions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260380454,"owners_count":23000276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","recovery","service","surveillance","telegram"],"created_at":"2024-10-10T20:16:27.495Z","updated_at":"2025-06-17T14:35:58.334Z","avatar_url":"https://github.com/Finesse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Deletions\n\nA simple CLI application to save messages deleted in specific Telegram chats.\n\nHow it works:\n1. The app signs-in to Telegram behalf your account\n2. The app watches all incoming messages in selected dialogs and saves them to disk\n3. When a saved message is deleted, the app posts the message to another chat\n\nThe script can't restore messages posted or deleted when it didn't run.\nSo you should always keep it running, ideally on a server.\n\n## Installation\n\nRequirements:\n- Python version 3.10 or newer\n- A Telegram account\n- Git (optional)\n\nDownload the code and install the dependencies:\n\n```bash\ngit clone --depth 1 git@github.com:Finesse/WordleSolver.git telegram_deletions\ncd telegram_deletions\npython3 -m venv .venv\nsource ./.venv/bin/activate\npython3 -m pip install --upgrade pip\npython3 -m pip install -r requirements.txt\ncp .env.example .env\n```\n\nGet a Telegram application credentials from https://my.telegram.org, under API Development.\nOr from https://tjhorner.dev/webogram/#/login.\n\nConfigure the app by editing the `.env` file (or provide the environment variable any other way):\n\n- `TELEGRAM_APP_ID` — the application id\n- `TELEGRAM_APP_HASH` — the application hash\n- `APP_DATA_DIRECTORY` (optional) — path to the directory to store data (cookie, messages) at.\n  The running application must have permissions to read and write in the directory.\n  The default is `data`.\n- Ignore the chat options for now\n\nList your dialogs to see their ids by running:\n\n```bash\npython3 src/list_dialogs.py\n```\n\nWhen you run it the first time, it will ask your credentials to sign in.\n\nConfigure `.env` again:\n\n- `APP_CHATS_TO_WATCH` — id of the chat(s) to watch (integer).\n    If multiple, must be separated by `,`.\n    You can find them after `Chat id:` in the dialog list.\n- `APP_CHAT_TO_OUTPUT` — input entity of the chat to post deleted messages (a Python function call string).\n    Copy the part after `Input entity:` in the dialog list.\n\n## Usage\n\nRun the app:\n\n```bash\npython3 src/watch_deletions.py\n```\n\nKeep it running. Press \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e to stop watching.\n\n\u003e [!WARNING]  \n\u003e The app never deletes messages from the data directory.\n\u003e You should remove them manually; it's ok to delete any message when the app is running. \n\n## Running as daemon\n\nThis section tells how to configure the app as a Linux service so that the app always runs.\n\nConnect to the server via SSH as a regular user.\nIt must have a sudo access to execute one command.\nInstall and configure the app following the above steps.\nMake sure you've called `python3 src/list_dialogs.py` on the server,\notherwise the service will stuck on the Telegram sign-in dialog.\n\n\u003e [!IMPORTANT]  \n\u003e The following steps assume the app directory is `~/telegram_deletions`.\n\u003e If it's false in your case, adjust the commands accordingly.\n\nRun on the server:\n\n```bash\nsudo loginctl enable-linger \"$USER\"\n\nmkdir -p ~/.config/systemd/user\nln -s ~/telegram_deletions/telegram_deletions.service ~/.config/systemd/user/telegram_deletions.service\nsystemctl --user daemon-reload\nsystemctl --user enable telegram_deletions\nsystemctl --user start telegram_deletions\n```\n\nCheck the logs to make sure it works:\n\n```bash\njournalctl --user -u telegram_deletions\n```\n\nIf you want to stop and unregister the service:\n\n```bash\nsystemctl --user stop telegram_deletions\nsystemctl --user disable telegram_deletions\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinesse%2Ftelegramdeletions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinesse%2Ftelegramdeletions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinesse%2Ftelegramdeletions/lists"}