venomous0x / WhatsAPI

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

Example error.... #119

Open rdroguett opened 11 years ago

rdroguett commented 11 years ago

I try execute the example for use the api but i have received this error...

[root@pbx tests]#php whatsapp.php -s 5697XXXXXXX Tes message! | grep "Send"

PHP Warning: Missing argument 2 for WhatsProt::RequestLastSeen(), called in /var/www/html/api/tests/whatsapp.php on line 104 and defined in /var/www/html/api/src/php/whatsprot.class.php on line 349 PHP Notice: Undefined variable: to in /var/www/html/api/src/php/whatsprot.class.php on line 359

nitam commented 11 years ago

Hi, I haven't tried whatsapi yet but based on your error message, it seems something else, try this way:

php whatsapp.php -s 5697XXXXXXX "Tes message!" | grep "Send"

With regard to the Undefined variable, you can simply edit whatsprot.class.php, go to line 359, get the variable and define it prior to its first use.

rdroguett commented 11 years ago

Hi i try but

[root@pbx tests]# php whatsapp.php -s 5697XXXXXXX "Tes message!" | grep "Send" PHP Warning: Missing argument 2 for WhatsProt::RequestLastSeen(), called in /var/www/html/api/tests/whatsapp.php on line 105 and defined in /var/www/html/api/src/php/whatsprot.class.php on line 349 PHP Notice: Undefined variable: to in /var/www/html/api/src/php/whatsprot.class.php on line 359 [] Send message to 5697XXXXXXX : Tes message! [root@pbx tests]#

ChaosMarc commented 11 years ago

what worked for me (no error but success message) was changing line 104 (tests/whatsapp.php) from $wa->RequestLastSeen($dst); to $wa->RequestLastSeen($dst, $argc[2]);

(msg sending now works :) "-l" and "-i" still get me errors :( )

rdroguett commented 11 years ago

Yeah it's true!!

[root@pbx tests]# php whatsapp.php -s 5697XXXXXX "Demo de envio" | grep "Send" [] Send message to 5697XXXXXX : Demo de envio [root@pbx tests]#

The syntax errors was fixed. But i don't receive any message :(