# TgEraser
[![PyPI version](https://badge.fury.io/py/tgeraser.svg)](https://badge.fury.io/py/tgeraser)
TgEraser is a Python tool that allows you to delete all your messages from a chat, channel, or conversation on Telegram without requiring admin privileges. Official Telegram clients do not provide a one-click solution to delete all your messages; instead, you have to manually select and delete messages, with a limit of 100 messages per batch. TgEraser solves this problem and offers a convenient way to mass-delete your messages on Telegram.
## Installation
```
pip install tgeraser
tgeraser
```
To use TgEraser, you'll need to provide `api_id` and `api_hash`, which you can obtain from [here](https://my.telegram.org/auth?to=apps).
There are two methods to define `api_id` and `api_hash`:
1. Set them as environment variables (`TG_API_ID` and `TG_API_HASH`).
2. Allow the tool to prompt you for input during execution, with an option to save the credentials in a `credentials.json` file located in the same directory as the sessions (by default, `~/.tgeraser/`).
## Usage
```
TgEraser deletes all your messages from a chat, channel, or conversation on Telegram without requiring admin privileges.
Usage:
tgeraser [(session <session_name>) --entity-type TYPE -l NUM [-d PATH] -p PEER_ID] | [-k]
tgeraser session <session_name> -p PEER_ID -t STRING
tgeraser session <session_name> -w [--entity-type TYPE]
tgeraser -h | --help
tgeraser --version
Options:
-d --directory PATH Specify a directory where your sessions are stored. [default: ~/.tgeraser/]
-w --wipe-everything Delete all messages from all entities of a certain type that you have in your dialog list.
--entity-type TYPE Available types: any, chat, channel, user. [default: chat]
-p --peers PEER_ID Specify certain peers by comma (chat/channel/user).
-l --limit NUM Show a specified number of recent chats.
-t --time-period STRING Specify a period for an infinite loop to run messages deletion every X seconds/minutes/hours/days/weeks.
Example: --time-period "3*days" OR --time-period "5*seconds"
-k --kill Terminate existing background TgEraser processes (only for Unix-like OS).
-h --help Show this screen.
--version Show version.
```
Executing the tool without options will guide you through the creation of your first user session. After that you can create sessions for multiple users using the `tgeraser session <new_session_name>` command.
## Contributing
If you have any issues or suggestions, please feel free to open an issue or submit a pull request.
Raw data
{
"_id": null,
"home_page": "https://github.com/en9inerd/tgeraser",
"name": "tgeraser",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": null,
"keywords": "telegram, api, delete messages",
"author": "Vladimir Loskutov",
"author_email": "vladimir@enginerd.io",
"download_url": "https://files.pythonhosted.org/packages/43/34/f10add4a52e461b8f2738b2b03452e56e5d70cff7df36b35f7f8aa79213d/tgeraser-1.2.8.tar.gz",
"platform": null,
"description": "# TgEraser\n\n[![PyPI version](https://badge.fury.io/py/tgeraser.svg)](https://badge.fury.io/py/tgeraser)\n\nTgEraser is a Python tool that allows you to delete all your messages from a chat, channel, or conversation on Telegram without requiring admin privileges. Official Telegram clients do not provide a one-click solution to delete all your messages; instead, you have to manually select and delete messages, with a limit of 100 messages per batch. TgEraser solves this problem and offers a convenient way to mass-delete your messages on Telegram.\n\n## Installation\n\n```\npip install tgeraser\ntgeraser\n```\n\nTo use TgEraser, you'll need to provide `api_id` and `api_hash`, which you can obtain from [here](https://my.telegram.org/auth?to=apps).\n\nThere are two methods to define `api_id` and `api_hash`:\n1. Set them as environment variables (`TG_API_ID` and `TG_API_HASH`).\n2. Allow the tool to prompt you for input during execution, with an option to save the credentials in a `credentials.json` file located in the same directory as the sessions (by default, `~/.tgeraser/`).\n\n## Usage\n\n```\nTgEraser deletes all your messages from a chat, channel, or conversation on Telegram without requiring admin privileges.\n\nUsage:\n tgeraser [(session <session_name>) --entity-type TYPE -l NUM [-d PATH] -p PEER_ID] | [-k]\n tgeraser session <session_name> -p PEER_ID -t STRING\n tgeraser session <session_name> -w [--entity-type TYPE]\n tgeraser -h | --help\n tgeraser --version\n\nOptions:\n -d --directory PATH Specify a directory where your sessions are stored. [default: ~/.tgeraser/]\n -w --wipe-everything Delete all messages from all entities of a certain type that you have in your dialog list.\n --entity-type TYPE Available types: any, chat, channel, user. [default: chat]\n -p --peers PEER_ID Specify certain peers by comma (chat/channel/user).\n -l --limit NUM Show a specified number of recent chats.\n -t --time-period STRING Specify a period for an infinite loop to run messages deletion every X seconds/minutes/hours/days/weeks.\n Example: --time-period \"3*days\" OR --time-period \"5*seconds\"\n -k --kill Terminate existing background TgEraser processes (only for Unix-like OS).\n -h --help Show this screen.\n --version Show version.\n```\n\nExecuting the tool without options will guide you through the creation of your first user session. After that you can create sessions for multiple users using the `tgeraser session <new_session_name>` command.\n\n## Contributing\n\nIf you have any issues or suggestions, please feel free to open an issue or submit a pull request.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Tool deletes all your messages from chat/channel/conversation on Telegram.",
"version": "1.2.8",
"project_urls": {
"Homepage": "https://github.com/en9inerd/tgeraser"
},
"split_keywords": [
"telegram",
" api",
" delete messages"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6392d693e624535e9200b8ca56428b754e3bf701599e4a8b0e25596a739afa24",
"md5": "23ad0bbfaa05a1aa495a9f83f5fe92c0",
"sha256": "d3b0768c22cd9e181436fbab1e96fa951f35522d09cc8a735bdba43dbb1c3819"
},
"downloads": -1,
"filename": "tgeraser-1.2.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "23ad0bbfaa05a1aa495a9f83f5fe92c0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.8",
"size": 9557,
"upload_time": "2024-04-26T16:51:18",
"upload_time_iso_8601": "2024-04-26T16:51:18.186249Z",
"url": "https://files.pythonhosted.org/packages/63/92/d693e624535e9200b8ca56428b754e3bf701599e4a8b0e25596a739afa24/tgeraser-1.2.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4334f10add4a52e461b8f2738b2b03452e56e5d70cff7df36b35f7f8aa79213d",
"md5": "f1af0aa28cb12a2872b3ce3d06241b8a",
"sha256": "700a25024a9396d534c028f6bc9bf0cfd901a231edc73bd4b61c0de2fca12f6d"
},
"downloads": -1,
"filename": "tgeraser-1.2.8.tar.gz",
"has_sig": false,
"md5_digest": "f1af0aa28cb12a2872b3ce3d06241b8a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.8",
"size": 8598,
"upload_time": "2024-04-26T16:51:19",
"upload_time_iso_8601": "2024-04-26T16:51:19.693425Z",
"url": "https://files.pythonhosted.org/packages/43/34/f10add4a52e461b8f2738b2b03452e56e5d70cff7df36b35f7f8aa79213d/tgeraser-1.2.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-26 16:51:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "en9inerd",
"github_project": "tgeraser",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "docopt",
"specs": [
[
"==",
"0.6.2"
]
]
},
{
"name": "pyaes",
"specs": [
[
"==",
"1.6.1"
]
]
},
{
"name": "pyasn1",
"specs": [
[
"==",
"0.6.0"
]
]
},
{
"name": "rsa",
"specs": [
[
"==",
"4.9"
]
]
},
{
"name": "telethon",
"specs": [
[
"==",
"1.35.0"
]
]
}
],
"lcname": "tgeraser"
}