Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetChatHistory.get_chat_history() got an unexpected keyword argument 'reverse' #453

Open
Exey opened this issue Jul 11, 2023 · 3 comments
Open
Labels

Comments

@Exey
Copy link

Exey commented Jul 11, 2023

Describe the bug
exception on py .\media_downloader.py

To Reproduce

chat_id: -1001632935915
last_read_message_id: 0
media_types:
- audio
- photo
- video
- document
- voice
file_formats:
  audio:
  - all
  document:
  - all
  video:
  - all

Python Version
Python: 3.11.4
pyrogram-2.0.106

OS:
Windows 10
WindowsVersion

1809

Logs
Traceback (most recent call last):
File "E:\tmd\x\media_downloader.py", line 376, in
main()
File "E:\tmd\x\media_downloader.py", line 360, in main
updated_config = asyncio.get_event_loop().run_until_complete(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Exey\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "E:\tmd\x\media_downloader.py", line 313, in begin_import
messages_iter = client.get_chat_history(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Exey\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\sync.py", line 53, in async_to_sync_wrap
coroutine = function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GetChatHistory.get_chat_history() got an unexpected keyword argument 'reverse'

@Exey
Copy link
Author

Exey commented Jul 13, 2023

After pip3 install -r requirements.txt
the same error but with heading:

py .\media_downloader.py
[17:43:34] Telegram Media Downloader v2.0.2,                                                                                                                                                                                                                                                               meta.py:18
           Copyright (C) 2019 Dineshkarthik <https://github.com/Dineshkarthik>
           Licensed under the terms of the MIT License                                                                                                                                                                                                                                                     meta.py:21

[17:43:34] INFO     Device: CPython 3.11.4 - Telegram Media Downloader 2.0.2                                                                                                                                                                                                                               meta.py:22
           INFO     System: Windows 10 (EN)                                                                                                                                                                                                                                                                meta.py:23
[17:43:35] INFO     Connecting...                                                                                                                                                                                                                                                                    connection.py:47
           INFO     Connected! Production DC2 - IPv4                                                                                                                                                                                                                                                 connection.py:54
           INFO     NetworkTask started                                                                                                                                                                                                                                                                session.py:294
           INFO     Session initialized: Layer 158                                                                                                                                                                                                                                                     session.py:139
           INFO     Device: CPython 3.11.4 - Pyrogram 2.0.106                                                                                                                                                                                                                                          session.py:140
           INFO     System: Windows 10 (en)                                                                                                                                                                                                                                                            session.py:141
           INFO     Session started                                                                                                                                                                                                                                                                    session.py:155
           INFO     PingTask started                                                                                                                                                                                                                                                                   session.py:272
           INFO     Started 32 HandlerTasks

@evi-snowm
Copy link

Ran into the same issue and the cause it a change in the pyrogram library. Solution seems to be to just remove the argument reverse (and it's value of True) from media_downloader.py line 313.

"The messages are returned in reverse chronological order." by default since that change.

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had recent activity in the past 45 days. It will be closed if no further activity occurs in the next 7 days. Thank you for your contributions.

@stale stale bot added the stale label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants