whatsapp-bot-seed
whatsapp-bot-seed copied to clipboard
How to set status and profile picture
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
You can do that using Yowsup CLI: sudo yowsup-cli demos -l YourRegisteredPhoneNumber:YourPassword --yowsup
I use: def status(message, match): return SetStatusIqProtocolEntity(match.group("profile_status"))
It would be nice if there is a configuration on config.py, and set profile pic and status on every startup...
@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)
I'll make a PR
#60