本文整理匯總了PHP中WhatsProt::sendPing方法的典型用法代碼示例。如果您正苦於以下問題:PHP WhatsProt::sendPing方法的具體用法?PHP WhatsProt::sendPing怎麽用?PHP WhatsProt::sendPing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WhatsProt
的用法示例。
在下文中一共展示了WhatsProt::sendPing方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: WhatsProt
$w = new WhatsProt($username, $nickname, $debug);
// bind events ------------------------------------------------------------------------------------------------------
// list semua event --> https://github.com/WHAnonymous/Chat-API/wiki/WhatsAPI-Documentation#list-of-all-events
$w->eventManager()->bind("onConnect", "onConnect");
$w->eventManager()->bind("onDisconnect", "onDisconnect");
$w->eventManager()->bind("onClose", "onClose");
$w->eventManager()->bind("onGetMessage", "onGetMessage");
$w->eventManager()->bind("onGetGroupMessage", "onGetGroupMessage");
// konek ------------------------------------------------------------------------------------------------------------
sleep(3);
$w->connect();
$w->loginWithPassword($password);
$w->sendGetServerProperties();
$w->sendClientConfig();
$w->sendGetGroups();
$w->sendPing();
// poll message loop ------------------------------------------------------------------------------------------------
while (1) {
if ($poll == 5) {
echo "\n[{$ke}][" . date('H:i:s') . "] ----------------------------------------------------\n";
echo "[{$ke}][" . date('H:i:s') . "] --- BOT SIAP!\n";
echo "[{$ke}][" . date('H:i:s') . "] --- \n";
echo "[{$ke}][" . date('H:i:s') . "] --- Sekarang coba kirim pesan ke bot ini,\n";
echo "[{$ke}][" . date('H:i:s') . "] --- seharusnya bot akan mengirim balik teks yang\n";
echo "[{$ke}][" . date('H:i:s') . "] --- dikirimkan ke dia.\n";
echo "[{$ke}][" . date('H:i:s') . "] --- \n";
echo "[{$ke}][" . date('H:i:s') . "] --- Ubah perilaku bot dengan mengedit function\n";
echo "[{$ke}][" . date('H:i:s') . "] --- onGetMessage() dan onGetGroupMessage()\n";
echo "[{$ke}][" . date('H:i:s') . "] --- di baris 126 dan baris 182.\n";
echo "[{$ke}][" . date('H:i:s') . "] --- \n";
echo "[{$ke}][" . date('H:i:s') . "] --- Semoga sukses!\n";