teleproto - v1.229.0
    Preparing search index...

    Function getInputPeer

    • Gets the input peer for the given "entity" (user, chat or channel).

      A TypeError is raised if the given entity isn't a supported type or if check_hash is True but the entity's accessHash is None or the entity contains min information. In this case, the hash cannot be used for general purposes, and thus is not returned to avoid any issues which can derive from invalid access hashes.

      Note that checkHash is ignored if an input peer is already passed since in that case we assume the user knows what they're doing. This is key to getting entities by explicitly passing hash = 0.

      Parameters

      • entity: any
      • allowSelf: boolean = true
      • checkHash: boolean = true

      Returns TypeInputPeer