def to_array(self):
        """
        Serializes this Message to a dictionary.

        :return: dictionary representation of this object.
        :rtype: dict
        """
        array = super(Message, self).to_array()
        array['message_id'] = int(self.message_id)  # type int
        array['date'] = int(self.date)  # type int
        array['chat'] = self.chat.to_array()  # type Chat
        if self.from_peer is not None:
            array['from'] = self.from_peer.to_array()  # type User
        if self.forward_from is not None:
            array['forward_from'] = self.forward_from.to_array()  # type User
        if self.forward_from_chat is not None:
            array['forward_from_chat'] = self.forward_from_chat.to_array()  # type Chat
        if self.forward_from_message_id is not None:
            array['forward_from_message_id'] = int(self.forward_from_message_id)  # type int
        if self.forward_signature is not None:
            array['forward_signature'] = u(self.forward_signature)  # py2: type unicode, py3: type str
        if self.forward_date is not None:
            array['forward_date'] = int(self.forward_date)  # type int
        if self.reply_to_message is not None:
            array['reply_to_message'] = self.reply_to_message.to_array()  # type Message
        if self.edit_date is not None:
            array['edit_date'] = int(self.edit_date)  # type int
        if self.media_group_id is not None:
            array['media_group_id'] = u(self.media_group_id)  # py2: type unicode, py3: type str
        if self.author_signature is not None:
            array['author_signature'] = u(self.author_signature)  # py2: type unicode, py3: type str
        if self.text is not None:
            array['text'] = u(self.text)  # py2: type unicode, py3: type str
        if self.entities is not None:
            array['entities'] = self._as_array(self.entities)  # type list of MessageEntity
        if self.caption_entities is not None:
            array['caption_entities'] = self._as_array(self.caption_entities)  # type list of MessageEntity
        if self.audio is not None:
            array['audio'] = self.audio.to_array()  # type Audio
        if self.document is not None:
            array['document'] = self.document.to_array()  # type Document
        if self.animation is not None:
            array['animation'] = self.animation.to_array()  # type Animation
        if self.game is not None:
            array['game'] = self.game.to_array()  # type Game
        if self.photo is not None:
            array['photo'] = self._as_array(self.photo)  # type list of PhotoSize
        if self.sticker is not None:
            array['sticker'] = self.sticker.to_array()  # type Sticker
        if self.video is not None:
            array['video'] = self.video.to_array()  # type Video
        if self.voice is not None:
            array['voice'] = self.voice.to_array()  # type Voice
        if self.video_note is not None:
            array['video_note'] = self.video_note.to_array()  # type VideoNote
        if self.caption is not None:
            array['caption'] = u(self.caption)  # py2: type unicode, py3: type str
        if self.contact is not None:
            array['contact'] = self.contact.to_array()  # type Contact
        if self.location is not None:
            array['location'] = self.location.to_array()  # type Location
        if self.venue is not None:
            array['venue'] = self.venue.to_array()  # type Venue
        if self.new_chat_members is not None:
            array['new_chat_members'] = self._as_array(self.new_chat_members)  # type list of User
        if self.left_chat_member is not None:
            array['left_chat_member'] = self.left_chat_member.to_array()  # type User
        if self.new_chat_title is not None:
            array['new_chat_title'] = u(self.new_chat_title)  # py2: type unicode, py3: type str
        if self.new_chat_photo is not None:
            array['new_chat_photo'] = self._as_array(self.new_chat_photo)  # type list of PhotoSize
        if self.delete_chat_photo is not None:
            array['delete_chat_photo'] = bool(self.delete_chat_photo)  # type bool
        if self.group_chat_created is not None:
            array['group_chat_created'] = bool(self.group_chat_created)  # type bool
        if self.supergroup_chat_created is not None:
            array['supergroup_chat_created'] = bool(self.supergroup_chat_created)  # type bool
        if self.channel_chat_created is not None:
            array['channel_chat_created'] = bool(self.channel_chat_created)  # type bool
        if self.migrate_to_chat_id is not None:
            array['migrate_to_chat_id'] = int(self.migrate_to_chat_id)  # type int
        if self.migrate_from_chat_id is not None:
            array['migrate_from_chat_id'] = int(self.migrate_from_chat_id)  # type int
        if self.pinned_message is not None:
            array['pinned_message'] = self.pinned_message.to_array()  # type Message
        if self.invoice is not None:
            array['invoice'] = self.invoice.to_array()  # type Invoice
        if self.successful_payment is not None:
            array['successful_payment'] = self.successful_payment.to_array()  # type SuccessfulPayment
        if self.connected_website is not None:
            array['connected_website'] = u(self.connected_website)  # py2: type unicode, py3: type str
        if self.passport_data is not None:
            array['passport_data'] = self.passport_data.to_array()  # type PassportData
        return array
def to_array ( self ) : array = super ( Message , self ) . to_array ( ) array [ 'message_id' ] = int ( self . message_id ) array [ 'date' ] = int ( self . date ) array [ 'chat' ] = self . chat . to_array ( ) if self . from_peer is not None : array [ 'from' ] = self . from_peer . to_array ( ) if self . forward_from is not None : array [ 'forward_from' ] = self . forward_from . to_array ( ) if self . forward_from_chat is not None : array [ 'forward_from_chat' ] = self . forward_from_chat . to_array ( ) if self . forward_from_message_id is not None : array [ 'forward_from_message_id' ] = int ( self . forward_from_message_id ) if self . forward_signature is not None : array [ 'forward_signature' ] = u ( self . forward_signature ) if self . forward_date is not None : array [ 'forward_date' ] = int ( self . forward_date ) if self . reply_to_message is not None : array [ 'reply_to_message' ] = self . reply_to_message . to_array ( ) if self . edit_date is not None : array [ 'edit_date' ] = int ( self . edit_date ) if self . media_group_id is not None : array [ 'media_group_id' ] = u ( self . media_group_id ) if self . author_signature is not None : array [ 'author_signature' ] = u ( self . author_signature ) if self . text is not None : array [ 'text' ] = u ( self . text ) if self . entities is not None : array [ 'entities' ] = self . _as_array ( self . entities ) if self . caption_entities is not None : array [ 'caption_entities' ] = self . _as_array ( self . caption_entities ) if self . audio is not None : array [ 'audio' ] = self . audio . to_array ( ) if self . document is not None : array [ 'document' ] = self . document . to_array ( ) if self . animation is not None : array [ 'animation' ] = self . animation . to_array ( ) if self . game is not None : array [ 'game' ] = self . game . to_array ( ) if self . photo is not None : array [ 'photo' ] = self . _as_array ( self . photo ) if self . sticker is not None : array [ 'sticker' ] = self . sticker . to_array ( ) if self . video is not None : array [ 'video' ] = self . video . to_array ( ) if self . voice is not None : array [ 'voice' ] = self . voice . to_array ( ) if self . video_note is not None : array [ 'video_note' ] = self . video_note . to_array ( ) if self . caption is not None : array [ 'caption' ] = u ( self . caption ) if self . contact is not None : array [ 'contact' ] = self . contact . to_array ( ) if self . location is not None : array [ 'location' ] = self . location . to_array ( ) if self . venue is not None : array [ 'venue' ] = self . venue . to_array ( ) if self . new_chat_members is not None : array [ 'new_chat_members' ] = self . _as_array ( self . new_chat_members ) if self . left_chat_member is not None : array [ 'left_chat_member' ] = self . left_chat_member . to_array ( ) if self . new_chat_title is not None : array [ 'new_chat_title' ] = u ( self . new_chat_title ) if self . new_chat_photo is not None : array [ 'new_chat_photo' ] = self . _as_array ( self . new_chat_photo ) if self . delete_chat_photo is not None : array [ 'delete_chat_photo' ] = bool ( self . delete_chat_photo ) if self . group_chat_created is not None : array [ 'group_chat_created' ] = bool ( self . group_chat_created ) if self . supergroup_chat_created is not None : array [ 'supergroup_chat_created' ] = bool ( self . supergroup_chat_created ) if self . channel_chat_created is not None : array [ 'channel_chat_created' ] = bool ( self . channel_chat_created ) if self . migrate_to_chat_id is not None : array [ 'migrate_to_chat_id' ] = int ( self . migrate_to_chat_id ) if self . migrate_from_chat_id is not None : array [ 'migrate_from_chat_id' ] = int ( self . migrate_from_chat_id ) if self . pinned_message is not None : array [ 'pinned_message' ] = self . pinned_message . to_array ( ) if self . invoice is not None : array [ 'invoice' ] = self . invoice . to_array ( ) if self . successful_payment is not None : array [ 'successful_payment' ] = self . successful_payment . to_array ( ) if self . connected_website is not None : array [ 'connected_website' ] = u ( self . connected_website ) if self . passport_data is not None : array [ 'passport_data' ] = self . passport_data . to_array ( ) return array
Serializes this Message to a dictionary.

        :return: dictionary representation of this object.
        :rtype: dict