whatsapp-bot-seed icon indicating copy to clipboard operation
whatsapp-bot-seed copied to clipboard

How to set status and profile picture

Open nauramutiara opened this issue 8 years ago • 6 comments

Hello. this is a great bot. and I want to ask how to set status like "/help for information" also set a profile picture for the bot on config.py maybe?? Thank You

nauramutiara avatar Mar 16 '16 20:03 nauramutiara

You can do that using Yowsup CLI: sudo yowsup-cli demos -l YourRegisteredPhoneNumber:YourPassword --yowsup

ghost avatar Mar 16 '16 23:03 ghost

I use: def status(message, match): return SetStatusIqProtocolEntity(match.group("profile_status"))

relima avatar Mar 17 '16 00:03 relima

It would be nice if there is a configuration on config.py, and set profile pic and status on every startup...

joaoricardo000 avatar Mar 17 '16 00:03 joaoricardo000

@joaoricardo000 I actually have something around those lines too:

def ImagemProfile(self, message, match): 
    for status in ["ServerOn", "ServerOff"]:
        try: 
            match.group(status)
            break
        except: pass

    src = Image.open("/home/***/.memegen/"+status+".jpg")
    pictureData = src.resize((640, 640)).tobytes("jpeg", "RGB")
    picturePreview = src.resize((96, 96)).tobytes("jpeg", "RGB")
    return SetPictureIqProtocolEntity("***@s.whatsapp.net", picturePreview, pictureData)

relima avatar Mar 17 '16 00:03 relima

I'll make a PR

ghost avatar Mar 17 '16 00:03 ghost

#60

ghost avatar Mar 17 '16 01:03 ghost