Skip to main content

TgEraser

PyPI version

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.

Looking for a Go version? Check out go-tgeraser — a Go implementation of this tool with pre-built binaries available.

Installation

pip install tgeraser
tgeraser

To use TgEraser, you'll need to provide api_id and api_hash, which you can obtain from here.

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 first execution, with an option to save the credentials in a credentials.json file located in the same directory as the sessions (by default, ~/.tgeraser/). Credentials file can be created/edited manually in the following format:
{
    "api_id": 111111,
    "api_hash": "abcdef1234567890abcdef1234567890"
}

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 -o STRING -m TYPES --delete-conversation --proxy HOST:PORT:SECRET]
    tgeraser session <session_name> -w [--entity-type TYPE -o STRING -m TYPES --delete-conversation --proxy HOST:PORT:SECRET]
    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.
    --delete-conversation       If set, delete the whole conversation (only valid for user-type peers).
    --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.
    -o --older-than STRING      Delete messages older than X seconds/minutes/hours/days/weeks.
                                Example: --older-than "3*days" OR --older-than "5*seconds"
    -m --media-type TYPES       Delete only specific media types (server-side filtering).
                                Comma-separated list of: photo, video, audio, voice, video_note, gif, document.
                                Use "media" to delete all media types. If not specified, deletes all messages.
                                Example: --media-type "photo,video" OR --media-type media
    --proxy HOST:PORT:SECRET    MTProto proxy (e.g. 1.2.3.4:443:deadbeef).
    -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.

Metadata

Release files for tgeraser 1.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tgeraser 1.6.3
File Size Uploaded Provenance Actions
tgeraser-1.6.3.tar.gz 10.4 kB Without provenance Details for tgeraser-1.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tgeraser 1.6.3
File Interpreter ABI Platform Actions
tgeraser-1.6.3-py3-none-any.whl Python 3 none any Details for tgeraser-1.6.3-py3-none-any.whl

Total release size: 21.7 kB

Release files / tgeraser-1.6.3.tar.gz

Download URL tgeraser-1.6.3.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
87e0b905f8f827578354be4cdade5fc330d040531760bed1f143d8aa5f74ed35
BLAKE2b-256 checksum
How to use checksums
cec34a80dcf6a262095619ac40839d28a664a44ff4a9944d681367ab87b4e232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tgeraser-1.6.3-py3-none-any.whl

Download URL tgeraser-1.6.3-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31e81692365c4a99c9a73edab9f4028f981e745d931dd967b3df5a6bb4dcee04
BLAKE2b-256 checksum
How to use checksums
a2cf7f08d74b7c23989dda8e62d73f9df9b54850ecc7ecfa02acd2b866a3e61d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tgeraser 1.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.6.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page