pyrofork: Add linked_forum field to Chat

Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
wulan17 2025-06-09 21:07:46 +07:00
parent 0e9a8c3966
commit c7b961df60
No known key found for this signature in database
GPG key ID: 737814D4B5FF0420

View file

@ -167,6 +167,10 @@ class Chat(Object):
The linked discussion group (in case of channels) or the linked channel (in case of supergroups). The linked discussion group (in case of channels) or the linked channel (in case of supergroups).
Returned only in :meth:`~pyrogram.Client.get_chat`. Returned only in :meth:`~pyrogram.Client.get_chat`.
linked_forum (:obj:`~pyrogram.types.Chat`, *optional*):
The linked monoforum (in case of channels) or the linked channel (in case of monoforum).
Returned only in :meth:`~pyrogram.Client.get_chat`.
send_as_chat (:obj:`~pyrogram.types.Chat`, *optional*): send_as_chat (:obj:`~pyrogram.types.Chat`, *optional*):
The default "send_as" chat. The default "send_as" chat.
Returned only in :meth:`~pyrogram.Client.get_chat`. Returned only in :meth:`~pyrogram.Client.get_chat`.
@ -259,6 +263,7 @@ class Chat(Object):
permissions: "types.ChatPermissions" = None, permissions: "types.ChatPermissions" = None,
distance: int = None, distance: int = None,
linked_chat: "types.Chat" = None, linked_chat: "types.Chat" = None,
linked_forum: "types.Chat" = None,
send_as_chat: "types.Chat" = None, send_as_chat: "types.Chat" = None,
available_reactions: Optional["types.ChatReactions"] = None, available_reactions: Optional["types.ChatReactions"] = None,
usernames: List["types.Username"] = None, usernames: List["types.Username"] = None,
@ -313,6 +318,7 @@ class Chat(Object):
self.permissions = permissions self.permissions = permissions
self.distance = distance self.distance = distance
self.linked_chat = linked_chat self.linked_chat = linked_chat
self.linked_forum = linked_forum
self.send_as_chat = send_as_chat self.send_as_chat = send_as_chat
self.available_reactions = available_reactions self.available_reactions = available_reactions
self.usernames = usernames self.usernames = usernames
@ -550,9 +556,14 @@ class Chat(Object):
linked_chat_raw = chats.get(full_chat.linked_chat_id, None) linked_chat_raw = chats.get(full_chat.linked_chat_id, None)
linked_forum_raw = chats.get(getattr(chat_raw, "linked_monoforum_id"), None)
if linked_chat_raw: if linked_chat_raw:
parsed_chat.linked_chat = Chat._parse_channel_chat(client, linked_chat_raw) parsed_chat.linked_chat = Chat._parse_channel_chat(client, linked_chat_raw)
if linked_forum_raw:
parsed_chat.linked_forum = Chat._parse_channel_chat(client, linked_forum_raw)
default_send_as = full_chat.default_send_as default_send_as = full_chat.default_send_as
if default_send_as: if default_send_as: