Giter Club home page Giter Club logo

telegram-message-cleaner's Introduction

Telegram Message Cleaner

There is simpler version: no message counting and prettytable. It's in the dev branch.

Telegram Message Cleaner is a python script that can show your statistics (how many messages from you) on all your group chats, and also remove all your messages from specified chats.

Requirements

  • Python 3.6 or higher
  • telethon
  • prettytable

Installing

Clone it or download manually.

    git clone https://github.com/S0Ulle33/telegram-message-cleaner.git
    cd telegram-message-cleaner

Install using system pip

    pip install -r requirements.txt

or using pipenv.

    pipenv install

Usage

Before working with Telegram’s API, you need to get your own API ID and hash:

  1. Follow this link and login with your phone number.
  2. Click under API Development tools.
  3. A Create new application window will appear. Fill in your application details. There is no need to enter any URL, and only the first two fields (App title and Short name) can currently be changed later.
  4. Click on Create application at the end. Remember that your API hash is secret and Telegram won’t let you revoke it. Don’t post it anywhere!
  5. Specify them in corresponding variables (api_id and api_hash) in telegram_message_cleaner.py
usage: telegram_message_cleaner_dev.py [-s [id id ...]] [-d [id id ...]]

Show stats for your messages in all/specified group chats
or delete all your messages in specified group chat(-s).

optional arguments:
  -h, --help            show this help message and exit
  -s [id [id ...]], --statistic [id [id ...]]
                        if you do not specify ID as an argument, it will show
                        stats of your messages for all group chats
  -d [id [id ...]], --delete [id [id ...]]
                        deletes all your messages from the specified group
                        chat ID(-s)

Examples:

1.Show stats for all your group chats:

    ./telegram_message_cleaner.py -s

    +------------+---------------+----------+
    |     ID     |     Group     | Messages |
    +------------+---------------+----------+
    | 1300197304 |   Work Group  | 234      |
    | 1210787553 | Bob and Alice | 75       |
    | 1274948231 |    Project    | 68       |
    +------------+---------------+----------+

2.Show stats only for 'Work Group' chat:

    ./telegram_message_cleaner.py -s 1300197304

    +------------+---------------+----------+
    |     ID     |     Group     | Messages |
    +------------+---------------+----------+
    | 1300197304 |   Work Group  | 234      |
    +------------+---------------+----------+

3.Show stats only for 'Bob and Alice' and 'Project' chats:

    ./telegram_message_cleaner.py -s 1210787553 1274948231

    +------------+---------------+----------+
    |     ID     |     Group     | Messages |
    +------------+---------------+----------+
    | 1210787553 | Bob and Alice | 75       |
    | 1274948231 |    Project    | 68       |
    +------------+---------------+----------+

4.Delete messages from 'Bob and Alice' chat:

    ./telegram_message_cleaner.py -d 1210787553

5.Delete messages from 'Bob and Alice', 'Project' chats:

    ./telegram_message_cleaner.py -d 1210787553 1274948231

telegram-message-cleaner's People

Contributors

s0ulle33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

telegram-message-cleaner's Issues

Is it still working?

Запускаю скрипт, ввожу цифру чата, а он трёт вообще все сообщения, включая личные беседы, после чего телеграм выкидывает из всех аккаунтов. Это телеграм что-то поменял, или я что-то делаю не то?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.