Closed GauthamramRavichandran closed 3 years ago
send_media gets the imagepath and it converts into a base64 and sends it.
send_media
def send_media(self, path, chatid, caption): imgBase64 = convert_to_base64(path) filename = os.path.split(path)[-1] return self.wapi_functions.sendImage(imgBase64, chatid, filename, caption)
I tried to pass a base64 img string directly to sendImage, but it was failing. How can I send image using base64?
sendImage
you could take a look at what convert_to_base64 does to get the base64 from the source image
Got it, need to add the mimetype within that string itself. Thank you!
send_media
gets the imagepath and it converts into a base64 and sends it.I tried to pass a base64 img string directly to
sendImage
, but it was failing. How can I send image using base64?