Example #1
0
 def write(self):
     return types.InputBotInlineResult(
         id=self.id,
         type="photo",
         send_message=types.InputBotInlineMessageMediaAuto(
             reply_markup=self.reply_markup.write() if self.reply_markup else None,
             **self.style.parse(self.caption)
         ),
         title=self.title,
         description=self.description,
         url=self.photo_url,
         thumb=types.InputWebDocument(
             url=self.thumb_url,
             size=0,
             mime_type="image/jpeg",
             attributes=[
                 types.DocumentAttributeImageSize(
                     w=0,
                     h=0
                 )
             ]
         ),
         content=types.InputWebDocument(
             url=self.thumb_url,
             size=0,
             mime_type="image/jpeg",
             attributes=[
                 types.DocumentAttributeImageSize(
                     w=self.photo_width,
                     h=self.photo_height
                 )
             ]
         )
     )
 def write(self):
     return types.InputBotInlineResult(
         id=str(self.id),
         type=self.type,
         send_message=self.input_message_content.write(self.reply_markup),
         title=self.title,
         description=self.description,
         url=self.url,
         thumb=types.InputWebDocument(url=self.thumb_url,
                                      size=0,
                                      mime_type="image/jpeg",
                                      attributes=[
                                          types.DocumentAttributeImageSize(
                                              w=self.thumb_width,
                                              h=self.thumb_height)
                                      ]) if self.thumb_url else None)