Add Chat.is_fake and User.is_fake

This commit is contained in:
Dan 2021-01-29 12:57:38 +01:00
parent 1bba5cad54
commit 57128c0ab7
2 changed files with 14 additions and 5 deletions

View File

@ -46,7 +46,10 @@ class Chat(Object):
True, if this chat owner is the current user. Supergroups, channels and groups only.
is_scam (``bool``, *optional*):
True, if this chat has been flagged for scam. Supergroups, channels and bots only.
True, if this chat has been flagged for scam.
is_fake (``bool``, *optional*):
True, if this chat has been flagged for impersonation.
is_support (``bool``):
True, if this chat is part of the Telegram support team. Users and bots only.
@ -125,6 +128,7 @@ class Chat(Object):
is_restricted: bool = None,
is_creator: bool = None,
is_scam: bool = None,
is_fake: bool = None,
is_support: bool = None,
title: str = None,
username: str = None,
@ -152,6 +156,7 @@ class Chat(Object):
self.is_restricted = is_restricted
self.is_creator = is_creator
self.is_scam = is_scam
self.is_fake = is_fake
self.is_support = is_support
self.title = title
self.username = username
@ -181,6 +186,7 @@ class Chat(Object):
is_verified=getattr(user, "verified", None),
is_restricted=getattr(user, "restricted", None),
is_scam=getattr(user, "scam", None),
is_fake=getattr(user, "fake", None),
is_support=getattr(user, "support", None),
username=user.username,
first_name=user.first_name,
@ -219,6 +225,7 @@ class Chat(Object):
is_restricted=getattr(channel, "restricted", None),
is_creator=getattr(channel, "creator", None),
is_scam=getattr(channel, "scam", None),
is_fake=getattr(channel, "fake", None),
title=channel.title,
username=getattr(channel, "username", None),
photo=types.ChatPhoto._parse(client, getattr(channel, "photo", None), peer_id, channel.access_hash),
@ -860,10 +867,6 @@ class Chat(Object):
.. code-block:: python
Parameters:
offset (``int``, *optional*):
Sequential number of the first member to be returned.
Only applicable to supergroups and channels. Defaults to 0 [1]_.
limit (``int``, *optional*):
Limits the number of members to be retrieved.
Only applicable to supergroups and channels.

View File

@ -91,6 +91,9 @@ class User(Object, Update):
is_scam (``bool``, *optional*):
True, if this user has been flagged for scam.
is_fake (``bool``, *optional*):
True, if this user has been flagged for impersonation.
is_support (``bool``, *optional*):
True, if this user is part of the Telegram support team.
@ -159,6 +162,7 @@ class User(Object, Update):
is_verified: bool = None,
is_restricted: bool = None,
is_scam: bool = None,
is_fake: bool = None,
is_support: bool = None,
first_name: str = None,
last_name: str = None,
@ -183,6 +187,7 @@ class User(Object, Update):
self.is_verified = is_verified
self.is_restricted = is_restricted
self.is_scam = is_scam
self.is_fake = is_fake
self.is_support = is_support
self.first_name = first_name
self.last_name = last_name
@ -215,6 +220,7 @@ class User(Object, Update):
is_verified=user.verified,
is_restricted=user.restricted,
is_scam=user.scam,
is_fake=user.fake,
is_support=user.support,
first_name=user.first_name,
last_name=user.last_name,