Skip to content

Commit

Permalink
Update resolve_peer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
deus-developer authored Nov 27, 2024
1 parent ba49bbf commit 13b8f97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyrogram/methods/advanced/resolve_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ async def resolve_peer(
if not self.is_connected:
raise ConnectionError("Client has not been started yet")

if peer_id in ("self", "me"):
return raw.types.InputPeerSelf()

try:
return await self.storage.get_peer_by_id(peer_id)
except KeyError:
if isinstance(peer_id, str):
if peer_id in ("self", "me"):
return raw.types.InputPeerSelf()

peer_id = re.sub(r"[@+\s]", "", peer_id.lower())

try:
Expand Down

0 comments on commit 13b8f97

Please sign in to comment.