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

adminlist command crashes #2

Open
mage1k99 opened this issue Feb 10, 2022 · 3 comments
Open

adminlist command crashes #2

mage1k99 opened this issue Feb 10, 2022 · 3 comments

Comments

@mage1k99
Copy link
Contributor

mage1k99 commented Feb 10, 2022

Seems like while handling a exception another exception occurred.

here is the stacktrace/log

'<' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/path_to_project_directory/ZeroTwo/venv/lib/python3.9/site-packages/pyrogram/methods/advanced/resolve_peer.py", line 60, in resolve_peer
    return await self.storage.get_peer_by_id(peer_id)
  File "/path_to_project_directory/ZeroTwo/venv/lib/python3.9/site-packages/pyrogram/storage/sqlite_storage.py", line 147, in get_peer_by_id
    raise KeyError(f"ID not found: {peer_id}")
KeyError: 'ID not found: None'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path_to_project_directory/ZeroTwo/venv/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 222, in handler_worker
    await handler.callback(self.client, *args)
  File "/path_to_project_directory/ZeroTwo/zerotwo.py", line 193, in adminlist
    async for member in ZeroTwo.iter_chat_members(chat_name, filter="administrators"):
  File "/path_to_project_directory/ZeroTwo/venv/lib/python3.9/site-packages/pyrogram/methods/chats/iter_chat_members.py", line 94, in iter_chat_members
    resolved_chat_id = await self.resolve_peer(chat_id)
  File "/path_to_project_directory/ZeroTwo/venv/lib/python3.9/site-packages/pyrogram/methods/advanced/resolve_peer.py", line 87, in resolve_peer
    peer_type = utils.get_peer_type(peer_id)
  File "/path_to_project_directory/ZeroTwo/venv/lib/python3.9/site-packages/pyrogram/utils.py", line 195, in get_peer_type
    if peer_id < 0:
TypeError: '<' not supported between instances of 'NoneType' and 'int'



@raveen2k3
Copy link
Owner

🌚👍

@Jeevan666
Copy link

Maybe try if peer_id is NONE First than see the check if it is smaller than 0

@raveen2k3
Copy link
Owner

Maybe try if peer_id is NONE First than see the check if it is smaller than 0

will check 2mrw bruh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants