danielcardeenas / whatsapp-framework

⚗️Whatsapp python api
1.16k stars 362 forks source link

Obtener la imagen del perfil #233

Open armandochavez opened 5 years ago

armandochavez commented 5 years ago

como obtengo la imagen de perfil del contacto

x-frst commented 5 years ago

Here's I coded one may help you just enable it in init.py and send !getdp <contact number> to get Profile pic

#modules/getdp.py
from app.mac import mac, signals

@signals.message_received.connect
def handle(message):
    # callback parameter optional
    def pp(who, path):
        print("Got profile", who, path)
        mac.send_image(path, message.conversation, "Profile Pic From: "+phn)
    if '!getdp' in message.text:
        phn = message.text[6:].replace(" ", '')
        mac.contact_picture_from(phn, pp, preview=False)
armandochavez commented 5 years ago

!getdp donde encuentro eso ?

x-frst commented 5 years ago

Leave it to get someone's Profile picture aka dp the function is mac.contact_picture_from()