def _do_send_file(self, media_path, url, to, ip=None, caption=None):
     """
         Now the media file has been uploaded and the whatsapp server returns a media_path.
         The media_path is then sent to the receipt.
     """
     entity = None
     if self.MEDIA_TYPE == DownloadableMediaMessageProtocolEntity.MEDIA_TYPE_VIDEO:
         entity = VideoDownloadableMediaMessageProtocolEntity.fromFilePath(media_path, url, self.MEDIA_TYPE, ip, to)
     elif self.MEDIA_TYPE == DownloadableMediaMessageProtocolEntity.MEDIA_TYPE_IMAGE:
         entity = ImageDownloadableMediaMessageProtocolEntity.fromFilePath(media_path, url, ip, to, caption=caption)
     self.interface_layer.toLower(entity)
Esempio n. 2
0
 def _do_send_file(self, file_path, url, to, ip=None, caption=None):
     """
         Now the media file has been uploaded and the whatsapp server returns a media_path.
         The media_path is then sent to the receipt.
     """
     entity = None
     if self.MEDIA_TYPE == DownloadableMediaMessageProtocolEntity.MEDIA_TYPE_VIDEO:
         entity = VideoDownloadableMediaMessageProtocolEntity.fromFilePath(file_path, url, self.MEDIA_TYPE, ip, to)
     elif self.MEDIA_TYPE == DownloadableMediaMessageProtocolEntity.MEDIA_TYPE_IMAGE:
         entity = ImageDownloadableMediaMessageProtocolEntity.fromFilePath(file_path, url, ip, to, caption=caption)
     elif self.MEDIA_TYPE == DownloadableMediaMessageProtocolEntity.MEDIA_TYPE_AUDIO:
         entity = AudioDownloadableMediaMessageProtocolEntity.fromFilePath(file_path, url, ip, to)
     self.interface_layer.toLower(entity)
Esempio n. 3
0
 def do_send_image(self, file_path, url, to, ip=None, caption=None):
     entity = ImageDownloadableMediaMessageProtocolEntity.fromFilePath(file_path, url, ip, to, caption=caption)
     self.toLower(entity)
Esempio n. 4
0
 def do_send_image(self, file_path, url, to, ip=None, caption=None):
     entity = ImageDownloadableMediaMessageProtocolEntity.fromFilePath(
         file_path, url, ip, to, caption=caption)
     self.toLower(entity)
Esempio n. 5
0
 def doSendImage(self, filePath, url, to, ip=None, caption=None):
     print("sending image")
     entity = ImageDownloadableMediaMessageProtocolEntity.fromFilePath(
         filePath, url, ip, to, caption=caption)
     self.toLower(entity)