gurland / telegram-delete-all-messages

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

TypeError: get_dialogs() got an unexpected keyword argument 'pinned_only' #53

Closed skarankevich closed 2 years ago

skarankevich commented 2 years ago

Traceback (most recent call last): File "/Users/admin/Projects/telegram-delete-all-messages/cleaner.py", line 134, in deleter.select_groups() File "/Users/admin/Projects/telegram-delete-all-messages/cleaner.py", line 50, in select_groups chats = self.get_all_chats() File "/Users/admin/Projects/telegram-delete-all-messages/cleaner.py", line 40, in get_all_chats dialogs = app.get_dialogs(pinned_only=True) File "/Users/admin/.pyenv/versions/3.9.12/lib/python3.9/site-packages/pyrogram/sync.py", line 53, in async_to_sync_wrap coroutine = function(*args, **kwargs) TypeError: get_dialogs() got an unexpected keyword argument 'pinned_only'

ghost commented 2 years ago

I can reproduce same issue on Arch Linux and Ubuntu 22.04 LTS.

ghost commented 2 years ago

I managed to run it. Issue is likely pyrogram module. By default, pyrogram 2.0 will be installed, but this python script isn't updated yet. I uninstalled pyrogram 2.0. pip3 uninstall pyrogram And I reinstalled pyrogram 1.4.16 pip3 install -U Pyrogram-1.4.16 done. Disclaimer: use my method at your own risk as I am not aware of potential security risks with downgrading Pyrogram.

AtomicSpark commented 2 years ago

I was able to reproduce the issue on Windows 11.

I was able to work around this by changing pyrogram to pyrogram<2.0 in requirements.txt and running install.bat again.

Thanks @andrsn0w for the tip!

gurland commented 2 years ago

Current version of the project uses pyrogram==1.4 fixed in #52 so closed for now.