alfred82santa / whalesong

Whalesong is an asyncio python library to manage WebApps remotely. Currently WhatsappWeb is implemented
https://whalesong.readthedocs.io
MIT License
50 stars 19 forks source link

pushName over whatsapp business #101

Open jesusvalverde opened 5 years ago

jesusvalverde commented 5 years ago

Describe the bug Using update_pushname do not change the Pushname in a whatsapp business

await self._driver.conn.update_pushname(name=statusAndPic['phoneName'])

Additional context no problems over set_my_status

parthibd commented 5 years ago

I believe this might be caused due to api differences between normal whatsapp web and whatsaspp business . Have you tried debugging?

parthibd commented 5 years ago

what is statusAndPic['phoneName'] ? Update pushname only takes as single string

parthibd commented 5 years ago

This is the definition of updatepushname def update_pushname(self, name: str) -> Result[None]: . See it takes a string . Would you mind sharing the code thats causing you the trouble ?

jesusvalverde commented 5 years ago

This is the Code... Build a Small backend to manage some bots utiliies

I get the statusAndPic['statusName'] and the statusAndPic['phoneName'] form and API, every hour, and of course the 2 var have data on it.

async def getStatusAndPic(self): PARAMS = urllib.parse.urlencode({'typo':'statusID', 'ip':self.myIp }) r=urllib.request.urlopen("https://api.xxxxx.com/phone.status.php?%s" % PARAMS) statusAndPic = json.loads(r.read())

     await self._driver.status.set_my_status(new_status=statusAndPic['statusName'])
     self.statusName=statusAndPic['statusName']

     await self._driver.conn.update_pushname(name=statusAndPic['phoneName'])
     self.phoneName=statusAndPic['phoneName']

    await asyncio.sleep(3660.0) #3660
    ensure_future(self.getStatusAndPic())
parthibd commented 5 years ago

What does statusAndPic['phoneName'] return ?

jesusvalverde commented 5 years ago

It's a char variable