mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add linked_forum field to Chat
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
ffec107a2c
commit
c0dcac1fde
1 changed files with 11 additions and 0 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue