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 Noneor 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 checkHashis 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.
Gets the input peer for the given "entity" (user, chat or channel).
A
TypeErroris raised if the given entity isn't a supported type or ifcheck_hash is Truebut the entity'saccessHash is Noneor the entity containsmininformation. 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
checkHashis 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 passinghash = 0.