From 3609d377522d7307bc4fa6228a5837bd46b6dff0 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 23 Apr 2018 19:25:38 +0200 Subject: [PATCH] Clean Chat type --- pyrogram/client/types/chat.py | 47 ++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/pyrogram/client/types/chat.py b/pyrogram/client/types/chat.py index d804c86b..c025cc52 100644 --- a/pyrogram/client/types/chat.py +++ b/pyrogram/client/types/chat.py @@ -27,7 +27,9 @@ class Chat(Object): Args: id (``int`` ``32-bit``): - Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. + Unique identifier for this chat. This number may be greater than 32 bits and some programming + languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, + so a signed 64 bit integer or double-precision float type are safe for storing this identifier. type (``str``): Type of chat, can be either "private", "group", "supergroup" or "channel". @@ -68,17 +70,32 @@ class Chat(Object): """ ID = 0xb0700002 - def __init__(self, id, type, title=None, username=None, first_name=None, last_name=None, all_members_are_administrators=None, photo=None, description=None, invite_link=None, pinned_message=None, sticker_set_name=None, can_set_sticker_set=None): - self.id = id # int - self.type = type # string - self.title = title # flags.0?string - self.username = username # flags.1?string - self.first_name = first_name # flags.2?string - self.last_name = last_name # flags.3?string - self.all_members_are_administrators = all_members_are_administrators # flags.4?Bool - self.photo = photo # flags.5?ChatPhoto - self.description = description # flags.6?string - self.invite_link = invite_link # flags.7?string - self.pinned_message = pinned_message # flags.8?Message - self.sticker_set_name = sticker_set_name # flags.9?string - self.can_set_sticker_set = can_set_sticker_set # flags.10?Bool + def __init__( + self, + id: int, + type: str, + title: str = None, + username: str = None, + first_name: str = None, + last_name: str = None, + all_members_are_administrators: bool = None, + photo=None, + description: str = None, + invite_link: str = None, + pinned_message=None, + sticker_set_name: str = None, + can_set_sticker_set: bool = None + ): + self.id = id + self.type = type + self.title = title + self.username = username + self.first_name = first_name + self.last_name = last_name + self.all_members_are_administrators = all_members_are_administrators + self.photo = photo + self.description = description + self.invite_link = invite_link + self.pinned_message = pinned_message + self.sticker_set_name = sticker_set_name + self.can_set_sticker_set = can_set_sticker_set