Support get_peer on participants and clarify some strings

This commit is contained in:
Lonami Exo
2019-01-07 16:13:37 +01:00
parent 00c8aa847d
commit d892a537a7
3 changed files with 13 additions and 10 deletions

View File

@@ -724,6 +724,10 @@ def get_peer(peer):
elif isinstance(peer, types.ChannelFull):
return types.PeerChannel(peer.id)
if peer.SUBCLASS_OF_ID in (0x7d7c6f86, 0xd9c7fc18):
# ChatParticipant, ChannelParticipant
return types.PeerUser(peer.user_id)
peer = get_input_peer(peer, allow_self=False, check_hash=False)
if isinstance(peer, types.InputPeerUser):
return types.PeerUser(peer.user_id)