Skip to content

miniproto.session.models.PeerCacheEntry

PeerCacheEntry(id: int, kind: PeerKind, access_hash: int | None = None, username: str | None = None, phone: str | None = None, updated_at: datetime = _utc_now(), raw: Mapping[str, Any] | None = None) -> None

Durable peer lookup metadata with a shallow-copied optional raw-field mapping.

raw is copied at its outer mapping level, so nested raw values remain mutable. phone is hidden from repr and optional access hashes remain absent for minimal Telegram peers.

Attributes:

  • id (int) – Positive Telegram peer identifier.
  • kind (PeerKind) – Peer category used to construct input peers.
  • access_hash (int | None) – Optional access hash required for some peer operations.
  • username (str | None) – Optional public username.
  • phone (str | None) – Optional private phone number, hidden from repr.
  • updated_at (datetime) – Last-known peer metadata timestamp; aware input retains its timezone.
  • raw (Mapping[str, Any] | None) – Optional shallow-copied extra raw fields; nested values remain mutable.

Raises: