@@ -163,11 +163,11 @@ def de_json(data):
163163 delete_chat_photo = data .get ('delete_chat_photo' , None ),
164164 group_chat_created = data .get ('group_chat_created' , None ))
165165
166- def to_data (self ):
166+ def to_dict (self ):
167167 data = {'message_id' : self .message_id ,
168- 'from' : self .from_user .to_data (),
168+ 'from' : self .from_user .to_dict (),
169169 'date' : self .date ,
170- 'chat' : self .chat .to_data ()}
170+ 'chat' : self .chat .to_dict ()}
171171 if self .forward_from :
172172 data ['forward_from' ] = self .forward_from
173173 if self .forward_date :
@@ -177,19 +177,19 @@ def to_data(self):
177177 if self .text :
178178 data ['text' ] = self .text
179179 if self .audio :
180- data ['audio' ] = self .audio .to_data ()
180+ data ['audio' ] = self .audio .to_dict ()
181181 if self .document :
182- data ['document' ] = self .document .to_data ()
182+ data ['document' ] = self .document .to_dict ()
183183 if self .photo :
184- data ['photo' ] = self . photo . to_data ()
184+ data ['photo' ] = [ p . to_dict () for p in self . photo ]
185185 if self .sticker :
186- data ['sticker' ] = self .sticker .to_data ()
186+ data ['sticker' ] = self .sticker .to_dict ()
187187 if self .video :
188- data ['video' ] = self .video .to_data ()
188+ data ['video' ] = self .video .to_dict ()
189189 if self .contact :
190- data ['contact' ] = self .contact .to_data ()
190+ data ['contact' ] = self .contact .to_dict ()
191191 if self .location :
192- data ['location' ] = self .location .to_data ()
192+ data ['location' ] = self .location .to_dict ()
193193 if self .new_chat_participant :
194194 data ['new_chat_participant' ] = self .new_chat_participant
195195 if self .left_chat_participant :
0 commit comments