mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Add Dialog to auto cast to peer
This commit is contained in:
parent
5498d14e54
commit
eb44c6634b
|
@ -794,12 +794,10 @@ def get_peer(peer):
|
||||||
return peer
|
return peer
|
||||||
elif isinstance(peer, (
|
elif isinstance(peer, (
|
||||||
types.contacts.ResolvedPeer, types.InputNotifyPeer,
|
types.contacts.ResolvedPeer, types.InputNotifyPeer,
|
||||||
types.TopPeer)):
|
types.TopPeer, types.Dialog, types.DialogPeer)):
|
||||||
return peer.peer
|
return peer.peer
|
||||||
elif isinstance(peer, types.ChannelFull):
|
elif isinstance(peer, types.ChannelFull):
|
||||||
return types.PeerChannel(peer.id)
|
return types.PeerChannel(peer.id)
|
||||||
elif isinstance(peer, types.DialogPeer):
|
|
||||||
return peer.peer
|
|
||||||
|
|
||||||
if peer.SUBCLASS_OF_ID in (0x7d7c6f86, 0xd9c7fc18):
|
if peer.SUBCLASS_OF_ID in (0x7d7c6f86, 0xd9c7fc18):
|
||||||
# ChatParticipant, ChannelParticipant
|
# ChatParticipant, ChannelParticipant
|
||||||
|
|
Loading…
Reference in New Issue
Block a user