Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- set_time_limit(90);
- require_once __DIR__.'src/whatsprot.class.php';
- require_once __DIR__.'src/events/MyEvents.php';
- //Change to your time zone
- date_default_timezone_set('America/Manaus');
- public function onGetMessage( $mynumber, $from, $id, $type, $time, $name, $body )
- {
- echo "Message from $name:\n$body\n\n";
- }
- $username = '559294603635';
- $password = 'io8zKRvnmq60Coug8ViZ0VpQuSM=';
- $nickname = 'William';
- $target = "559294511684";
- $debug = true;
- $w = new WhatsProt($username, $nickname, $debug);
- $w->connect();
- $w->loginWithPassword($password);
- $w->eventManager()->bind('onGetMessage', 'onGetMessage');
- $w->sendGetPrivacyBlockedList();
- $w->sendGetClientConfig();
- //$w->sendGetServerProperties();
- $w->sendMessageImage($target, 'demo/x3.jpg');
- $w->sendMessage($target, 'Guess the number :)');
- while (1) {
- $w->pollMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement