code: def photo(self):
          
          if isinstance(self.media, types.MessageMediaPhoto):
              if isinstance(self.media.photo, types.Photo):
                  return self.media.photo
          elif isinstance(self.action, types.MessageActionChatEditPhoto):
              return self.action.photo
          else:
              web = self.web_preview
              if web and isinstance(web.photo, types.Photo):
                  return web.photo
docs: If the message media is a photo, this returns the :tl:`Photo` object.
          This will also return the photo for :tl:`MessageService` if their
          action is :tl:`MessageActionChatEditPhoto`.