2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Clean Chat type

This commit is contained in:
Dan 2018-04-23 19:25:38 +02:00
parent b8473c9f7f
commit 3609d37752

View File

@ -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