本文整理汇总了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";