當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WhatsProt::sendStatusUpdate方法代碼示例

本文整理匯總了PHP中WhatsProt::sendStatusUpdate方法的典型用法代碼示例。如果您正苦於以下問題:PHP WhatsProt::sendStatusUpdate方法的具體用法?PHP WhatsProt::sendStatusUpdate怎麽用?PHP WhatsProt::sendStatusUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WhatsProt的用法示例。


在下文中一共展示了WhatsProt::sendStatusUpdate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateStatus

 /**
  * @param $status
  * @return bool
  */
 public function updateStatus($status)
 {
     if (isset($status) && trim($status) !== '') {
         $this->connectToWhatsApp();
         $this->wa->sendStatusUpdate($status);
         return true;
     }
     return false;
 }
開發者ID:djade007,項目名稱:WhatsApp,代碼行數:13,代碼來源:WhatsAppApi.php

示例2: exit

                default:
                    echo "[] Send message to {$dst}: {$line}\n";
                    $wa->sendMessage($dst, $line);
                    break;
            }
        }
    }
    exit(0);
}
if ($_SERVER['argv'][1] == "-l") {
    echo "\n[] Listen mode:\n";
    while (TRUE) {
        $wa->pollMessages();
        $data = $wa->getMessages();
        if (!empty($data)) {
            print_r($data);
        }
        sleep(1);
    }
    exit(0);
}
if ($_SERVER['argv'][1] == "-set") {
    echo "\n[] Setting status:\n";
    $wa->sendStatusUpdate($_SERVER['argv'][2]);
    exit(0);
}
echo "\n[] Request last seen {$dst}: ";
$wa->sendGetRequestLastSeen($dst);
echo "\n[] Send message to {$dst}: {$msg}\n";
$wa->sendMessage($dst, $msg);
echo "\n";
開發者ID:diamondobama,項目名稱:WhatsAPI,代碼行數:31,代碼來源:whatsapp.php

示例3: WhatsProt

$username = $argv[1];
$password = $argv[2];
$nickname = $argv[3];
$identity = $argv[4];
$method = $argv[5];
$args = $argv[6];
$targets = $argv[7];
echo "Username: " . $username . "\r\n";
echo "Password: " . $password . "\r\n";
echo "Nickname: " . $nickname . "\r\n";
echo "Identity: " . $identity . "\r\n";
echo "Method: " . $method . "\r\n";
echo "Args: " . $args . "\r\n";
$w = new WhatsProt($username, $identity, $nickname, true);
$w->connect();
$w->loginWithPassword($password);
if ($method == "sendStatusUpdate") {
    echo "About to send status update.\r\n";
    $w->sendStatusUpdate($args);
} elseif ($method == "sendProfilePicture") {
    echo "About to send profile picture.\r\n";
    $w->sendSetProfilePicture($args);
} elseif ($method == "broadcastMessage") {
    $targets = explode(",", $targets);
    echo "About to broadcast a message.\r\n" . print_r($targets) . "\r\n";
    $w->sendBroadcastMessage($targets, $args);
} elseif ($method == "sendBroadcastImage") {
    $targets = explode(",", $targets);
    $w->sendBroadcastImage($targets, $args, false);
}
sleep(5);
開發者ID:sadiqhirani,項目名稱:whatsapinet,代碼行數:31,代碼來源:broadcast.php

示例4: trim

     break;
 case '/contacts':
     $show = true;
     break;
 case '/status':
     echo "\nEnter your status > ";
     $status = trim(fgets(STDIN));
     do {
         echo "\nIs it right yes/no > ";
         $check = trim(fgets(STDIN));
         if ($check != 'yes') {
             echo "\nEnter your status > ";
             $status = trim(fgets(STDIN));
         }
     } while ($check != 'yes');
     $w->sendStatusUpdate($status);
     break;
 case '/profile':
     echo "\nEnter your profile picture URL > ";
     $profile = trim(fgets(STDIN));
     do {
         echo "\nIs it right yes/no > ";
         $check = trim(fgets(STDIN));
         if ($check != 'yes') {
             echo "\nEnter your profile picture URL > ";
             $profile = trim(fgets(STDIN));
         }
     } while ($check != 'yes');
     if (!filter_var($profile, FILTER_VALIDATE_URL) === false) {
         if (@getimagesize($profile) !== false) {
             $w->sendSetProfilePicture($profile);
開發者ID:MattPorto,項目名稱:Chat-API,代碼行數:31,代碼來源:client.php

示例5: WhatsProt

<?php

require_once '../whatsprot.class.php';
$username = "436646473355";
//Mobile Phone prefixed with country code so for india it will be 91xxxxxxxx
$password = "Z10t1ePNG1CsjZy5hrnHgXm/v1g=";
$w = new WhatsProt($username, 0, "ADarkHero Whatsapp Bot", true);
//Name your application by replacing "WhatsApp Messaging"
$w->connect();
$w->loginWithPassword($password);
$w->sendStatusUpdate("Offizieller ADarkHero WhatsApp Bot!");
sleep(1);
$w->pollMessage();
開發者ID:abazad,項目名稱:Good-Morning-WhatsApp-Bot,代碼行數:13,代碼來源:setStatusUpdate.php


注:本文中的WhatsProt::sendStatusUpdate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。