gurland / telegram-delete-all-messages

Delete all your messages in groups / supergroups using this python script
GNU General Public License v3.0
368 stars 85 forks source link

Remove chat reactions & update to pyrogram v2 #77

Open bgrishenko opened 1 month ago

bgrishenko commented 1 month ago

I took @qqwbarta 's PR and also added a script to remove reactions from chats. It only works for chats, so no channels at this time.

I couldn't get reactions on messages AND delete reactions on messages working with only one telegram library, so I had to include telethon as well.

tonwhite commented 1 month ago

Tried your updated code and see absolutely no results, messages are not getting deleted at all.

I also cannot see the errors, because the powershell window closes all the time and you literally can't troubleshoot. Please, add some pauses or some other logic, so you close the windows only manually.

Also, I was able to catch an error on the video. I says: Searching messages OFFSETT 0 420412, 420411] C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\cleaner.py:121: RuntimeWarning: coroutine 'Stop.stop' was never awaited app.stop() RuntimeWarning: Enable tracemalloc to get the object allocation traceback Traceback (most recent call last): File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\cleaner.py", line 145, in app.run(main()) File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\venv\Lib\site-packages\pyrogram\methods\utilities\run.py", line 77, in run run(coroutine) File "A:\Users\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete return future.result() File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\cleaner.py", line 116, in main await deleter.run() File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\cleaner.py", line 91, in run await self.delete_messages(chat_id, message_ids=message_ids) File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\cleaner.py", line 99, in delete_messages await app.delete_messages(chat_id=chat.id, message_ids=chunk) File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\venv\Lib\site-packages\pyrogram\methods\messages\delete_messages.py", line 66, in delete_messages peer = await self.resolve_peer(chat_id) File "C:\Users\Desktop\telegram-delete-all-messages-chat_rm_reactions\venv\Lib\site-packages\pyrogram\methods\advanced\resolve_peer.py", line 59, in resolve_peer raise ConnectionError("Client has not been started yet") ConnectionError: Client has not been started yet

bgrishenko commented 1 month ago

Tried your updated code and see absolutely no results, messages are not getting deleted at all.

I also cannot see the errors, because the powershell window closes all the time and you literally can't troubleshoot. Please, add some pauses or some other logic, so you close the windows only manually.

I haven't tested in windows. Please feel free to add your own pauses.

gavrilov commented 2 weeks ago

Tried your updated code and see absolutely no results, messages are not getting deleted at all.

I updated a bgrishenko version - now everything works for me Check pr https://github.com/gurland/telegram-delete-all-messages/pull/78