Open gameuser1982 opened 6 months ago
Be sure that both side added to contact each other
@gameuser1982 Monkeypatch pyrogram.utils.get_peer_type
import pyrogram.utils as utils
def get_peer_type(peer_id: int) -> str:
print('get_peer_type call')
peer_id_str = str(peer_id)
if not peer_id_str.startswith("-"):
return "user"
elif peer_id_str.startswith("-100"):
return "channel"
else:
return "chat"
utils.get_peer_type = get_peer_type
thx @AndrewFucher for solution.
Checklist
pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip
and reproduced the issue using the latest development versionDescription
pyrogram.errors.exceptions.bad_request_400.PeerIdInvalid: Telegram says: [400 PEER_ID_INVALID] - The peer id being used is invalid or not known yet. Make sure you meet the peer before interacting with it
Steps to reproduce
Code example
Logs