Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Define o tempo de execução ilimitado
- set_time_limit( 0 );
- // Define o horário para brasil
- date_default_timezone_set( 'America/Sao_Paulo' );
- // Dados de login
- $username = "5527988571807";
- $password = "N9lpAJRtpT+6nhbXoq/iq8J6Xhs=";
- $nickname = "Nescom";
- $target = "5527996346399";
- $debug = false;
- // Inlui o arquivo com a classe
- require '../src/whatsprot.class.php';
- require 'exampleAudioReceiveEvent.php';
- while ( true ) {
- try {
- $w = new WhatsProt( $username, $nickname, $debug );
- $events = new Events( $w );
- $events->setEventsToListenFor( $events->activeEvents );
- $w->connect();
- $w->loginWithPassword( $password );
- while ( $w->pollMessage() ) {
- ;
- }
- $w->sendPing();
- sleep( 10 );
- } catch ( Exception $e ) {
- echo "Houve exception, vai reiniciar o programa\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement