From e8ee3810d586710216aa27065f0f8d39376c129c Mon Sep 17 00:00:00 2001 From: KurimuzonAkuma Date: Sun, 22 Oct 2023 22:13:56 +0300 Subject: [PATCH] Stories fields in `User` and `Chat` object --- pyrogram/types/user_and_chats/chat.py | 12 ++++++++++++ pyrogram/types/user_and_chats/user.py | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/pyrogram/types/user_and_chats/chat.py b/pyrogram/types/user_and_chats/chat.py index 6cbe3350..3e203a15 100644 --- a/pyrogram/types/user_and_chats/chat.py +++ b/pyrogram/types/user_and_chats/chat.py @@ -61,6 +61,12 @@ class Chat(Object): is_support (``bool``): True, if this chat is part of the Telegram support team. Users and bots only. + is_stories_hidden (``bool``): + True, if this chat has hidden stories. + + is_stories_unavailable (``bool``): + True, if this chat stories is unavailable. + title (``str``, *optional*): Title, for supergroups, channels and basic group chats. @@ -157,6 +163,8 @@ class Chat(Object): is_scam: bool = None, is_fake: bool = None, is_support: bool = None, + is_stories_hidden: bool = None, + is_stories_unavailable: bool = None, title: str = None, username: str = None, usernames: List["types.Username"] = None, @@ -191,6 +199,8 @@ class Chat(Object): self.is_scam = is_scam self.is_fake = is_fake self.is_support = is_support + self.is_stories_hidden = is_stories_hidden + self.is_stories_unavailable = is_stories_unavailable self.title = title self.username = username self.usernames = usernames @@ -269,6 +279,8 @@ class Chat(Object): is_creator=getattr(channel, "creator", None), is_scam=getattr(channel, "scam", None), is_fake=getattr(channel, "fake", None), + is_stories_hidden=getattr(channel, "stories_hidden", None), + is_stories_unavailable=getattr(channel, "stories_unavailable", None), title=channel.title, username=getattr(channel, "username", None), usernames=types.List([types.Username._parse(r) for r in usernames]) or None, diff --git a/pyrogram/types/user_and_chats/user.py b/pyrogram/types/user_and_chats/user.py index 9f0cb8a7..fe7e5610 100644 --- a/pyrogram/types/user_and_chats/user.py +++ b/pyrogram/types/user_and_chats/user.py @@ -100,6 +100,15 @@ class User(Object, Update): is_premium (``bool``, *optional*): True, if this user is a premium user. + is_close_friend (``bool``): + True, if this user is a close friend. + + is_stories_hidden (``bool``): + True, if this user has hidden stories. + + is_stories_unavailable (``bool``): + True, if this chat stories is unavailable. + first_name (``str``, *optional*): User's or bot's first name. @@ -169,6 +178,9 @@ class User(Object, Update): is_fake: bool = None, is_support: bool = None, is_premium: bool = None, + is_close_friend: bool = None, + is_stories_hidden: bool = None, + is_stories_unavailable: bool = None, first_name: str = None, last_name: str = None, status: "enums.UserStatus" = None, @@ -197,6 +209,9 @@ class User(Object, Update): self.is_fake = is_fake self.is_support = is_support self.is_premium = is_premium + self.is_close_friend = is_close_friend + self.is_stories_hidden = is_stories_hidden + self.is_stories_unavailable = is_stories_unavailable self.first_name = first_name self.last_name = last_name self.status = status @@ -241,6 +256,9 @@ class User(Object, Update): is_fake=user.fake, is_support=user.support, is_premium=user.premium, + is_close_friend=user.close_friend, + is_stories_hidden=user.stories_hidden, + is_stories_unavailable=user.stories_unavailable, first_name=user.first_name, last_name=user.last_name, **User._parse_status(user.status, user.bot),