Skip to content

miniproto.peers.PeerCache.resolve_peer

resolve_peer(peer: Peer | str | int) -> Peer

Resolve a peer object, numeric ID, phone number, self alias, or username.

Numeric IDs use cached peers first, then seed from dialogs. Usernames may call Telegram after the 24-hour local username cache expires.

Raises:

  • NotFound – If the reference is empty, unknown, or lacks an access hash.
  • RpcError – If remote username resolution returns an unexpected result.

Parameters:

  • peer (Peer | str | int) – Existing peer, signed/numeric ID, self alias, phone, or username.