mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Bot API 3.3.
This commit is contained in:
parent
6696c8e9ad
commit
c8349112d0
3 changed files with 39 additions and 14 deletions
|
|
@ -11,7 +11,9 @@ class Chat(Deserializable):
|
|||
"""
|
||||
|
||||
def __init__(self, id, type, title, username, first_name, last_name, all_members_are_administrators, photo,
|
||||
description, invite_link):
|
||||
description, invite_link, pinned_message):
|
||||
from .message import Message
|
||||
|
||||
self.id: int = id
|
||||
self.type: str = type
|
||||
self.title: str = title
|
||||
|
|
@ -22,9 +24,12 @@ class Chat(Deserializable):
|
|||
self.photo: ChatPhoto = photo
|
||||
self.description: str = description
|
||||
self.invite_link: str = invite_link
|
||||
self.pinned_message: Message = pinned_message
|
||||
|
||||
@classmethod
|
||||
def de_json(cls, raw_data) -> 'Chat':
|
||||
from .message import Message
|
||||
|
||||
id: int = raw_data.get('id')
|
||||
type: str = raw_data.get('type')
|
||||
title: str = raw_data.get('title')
|
||||
|
|
@ -35,9 +40,10 @@ class Chat(Deserializable):
|
|||
photo = raw_data.get('photo')
|
||||
description = raw_data.get('description')
|
||||
invite_link = raw_data.get('invite_link')
|
||||
pinned_message: Message = Message.deserialize(raw_data.get('pinned_message'))
|
||||
|
||||
return Chat(id, type, title, username, first_name, last_name, all_members_are_administrators, photo,
|
||||
description, invite_link)
|
||||
description, invite_link, pinned_message)
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue