Skip to content

miniproto.peers.PeerCache.get_me

get_me(*, refresh: bool = False) -> User

Return the authenticated user, reading cache unless refresh is true.

Parameters:

  • refresh (bool) – When true, try users.getUsers(inputUserSelf) first. If its result lacks a self user, return a cached identity when one exists; otherwise raise Unauthorized.

Raises:

  • Unauthorized – If Telegram does not return a concrete self user and no cached identity is available.