venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.14k forks source link

How can I get emoji icon in the listener #1107

Open yanelev opened 9 years ago

yanelev commented 9 years ago

Trying to get emoji display on my pc. What is the code for it.

This is what I have:

$wa = new WhatsProt($userPhone, $userIdentity, $userName, $debug); //$wa->eventManager()->bind("onGetMessage", "onMessage"); $wa->eventManager()->bind("onGetImage", "onImage"); $wa->connect(); $wa->loginWithPassword($password); for($i = 0; $i < 10; $i++) { $wa->pollMessage(); } $msgs=$wa->getMessages(); //store all messages in $msgs foreach($msgs as $m){
foreach ($m->getChildren() as $child) { var_dump($child); switch($child->getTag()) { case "body": $body = $child->getData(); break; case "notify": $name = $child->getAttribute("name"); break; case "media": $body = $child->getAttribute("url"); break; default: echo "Unknown node with tag " . $child->getTag() . "\r\n"; } } }

Thx

mgp25 commented 9 years ago

@yanelev this repo is inactive, use WhatsAPI Official https://github.com/mgp25/WhatsAPI-Official

Regards

yanelev commented 9 years ago

cool. thx