From 6a16933aadcbcb6aa209d681ccd8af21093564f8 Mon Sep 17 00:00:00 2001 From: wulan17 Date: Tue, 6 Feb 2024 23:57:06 +0700 Subject: [PATCH] Pyrofork: Add is_contacts_only field to User Signed-off-by: wulan17 --- pyrofork/types/user_and_chats/user.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyrofork/types/user_and_chats/user.py b/pyrofork/types/user_and_chats/user.py index 83029762..32126e60 100644 --- a/pyrofork/types/user_and_chats/user.py +++ b/pyrofork/types/user_and_chats/user.py @@ -101,6 +101,9 @@ class User(Object, Update): is_premium (``bool``, *optional*): True, if this user is a premium user. + is_contacts_only (``bool``, *optional*): + True, if this user is only allow incoming message from users in their contacts/premium users. + first_name (``str``, *optional*): User's or bot's first name. @@ -177,6 +180,7 @@ class User(Object, Update): is_fake: bool = None, is_support: bool = None, is_premium: bool = None, + is_contacts_only: bool = None, first_name: str = None, last_name: str = None, status: "enums.UserStatus" = None, @@ -207,6 +211,7 @@ class User(Object, Update): self.is_fake = is_fake self.is_support = is_support self.is_premium = is_premium + self.is_contacts_only = is_contacts_only self.first_name = first_name self.last_name = last_name self.status = status @@ -266,6 +271,7 @@ class User(Object, Update): is_fake=user.fake, is_support=user.support, is_premium=user.premium, + is_contacts_only=user.contact_require_premium, first_name=user.first_name, last_name=user.last_name, **User._parse_status(user.status, user.bot),