mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add Chat.parse_dialog
This commit is contained in:
parent
603bc88aa3
commit
8c02a1553d
@ -149,6 +149,15 @@ class Chat(PyrogramType):
|
|||||||
|
|
||||||
return Chat.parse_channel_chat(client, chats[message.to_id.channel_id])
|
return Chat.parse_channel_chat(client, chats[message.to_id.channel_id])
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def parse_dialog(client, peer, users: dict, chats: dict):
|
||||||
|
if isinstance(peer, types.PeerUser):
|
||||||
|
return Chat.parse_user_chat(client, users[peer.user_id])
|
||||||
|
elif isinstance(peer, types.PeerChat):
|
||||||
|
return Chat.parse_chat_chat(client, chats[peer.chat_id])
|
||||||
|
else:
|
||||||
|
return Chat.parse_channel_chat(client, chats[peer.channel_id])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_full(client, chat_full: types.messages.ChatFull or types.UserFull) -> "Chat":
|
def parse_full(client, chat_full: types.messages.ChatFull or types.UserFull) -> "Chat":
|
||||||
if isinstance(chat_full, types.UserFull):
|
if isinstance(chat_full, types.UserFull):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user