whatsapp-framework
whatsapp-framework copied to clipboard
image_send not working
I am not able to send images using this framework. I am not getting any error.
please post the code you're using
@signals.initialized.connect def send_image(message): mac.send_image_to("D:/test.png","91XXXXXXXXXX")
Is there any library or module that I need to install to work with media.
if i'm not wrong, you need PIL for images and ffmpeg-next for videos, but if you not getting any erros, i'm quite sure thats not the problem.
also, you can try putting your image inside a folder inside your script folder, and use:
import os
@signals.initialized.connect
def send_image(message):
mac.send_image_to( os.getcwd() + "app/assets/test.png", "91XXXXXXXXXX")
Still, it's not working. I guess it's not a path issue because when I put the wrong path it says "image does not exist". I am using ffmpeg-python (0.1.10) and Pillow (5.0.0). What do you think what is the problem?
You already answered that, "image does not exist" is the problem. Put your image inside app\assets\images\YOUR_IMAGE folder
app\
assets\
images\
YOUR_IMAGE.PNG
then:
mac.send_image_to( "app/assets/YOUR_IMAGE.PNG", "91XXXXXXXXXX")
AttributeError: 'ImageDownloadableMediaMessageProtocolEntity' object has no attr ibute 'getMediaKey'
Well, this can be much deep in code that i understand, maybe @danielcardeenas or @tgalal can help you.
Same or similar issue here. I am also not able to send any image. Sometimes get that same error you posted... but i am not sure if that is really related.
Also tried to use the pokemon code and it is also failing to send.
It seems we have a real bug.
debug info attached debug.log
The "no attribute 'getMediaKey'" error only happens when the bot receives an image. So this might be a different issue.
File "/home/leo/bot/whatsapp-framework/app/models/message.py", line 24, in build self.build_media_message() File "/home/leo/bot/whatsapp-framework/app/models/message.py", line 42, in build_media_message self.file_path = downloader.get_file(self.message_entity) File "/home/leo/bot/whatsapp-framework/app/utils/downloader.py", line 13, in get_file out_file = decrypt_file(message_entity, enc_path) File "/home/leo/bot/whatsapp-framework/app/utils/downloader.py", line 36, in decrypt_file key = message_entity.getMediaKey() AttributeError: 'ImageDownloadableMediaMessageProtocolEntity' object has no attribute 'getMediaKey'
anyone ? :(
Same errors i have not errors but images not send. @danielcardeenas we need help