break; case "HELP": $sendMsg = ['chat_id' => $chatId, 'text' => HELP_HELP]; break; case "PING": $sendMsg = ['chat_id' => $chatId, 'text' => HELP_PING]; break; default: $sendMsg = ['chat_id' => $chatId, 'text' => HELP_UNKNOWN]; } $telegram->sendMessage($sendMsg); break; case "/FIND": if ($command[1] != "") { $res1 = sendPost('http://3wifi.stascorp.com/user.php?a=login', 'login=antichat&password=antichat'); $res2 = sendPost('http://3wifi.stascorp.com/3wifi.php?a=find', 'essid=' . $command[1]); $json = json_decode($res2, true); if (count($json['data']) > 0) { foreach ($json['data'] as $d) { $sendMsg = ['chat_id' => $chatId, 'text' => substr($d['time'], 0, strpos(trim($d['time']), ' ')) . " " . $d['comment'] . "\n" . $d['range'] . "\n" . $d['bssid'] . "|" . $d['essid'] . "\n" . "(" . $d['sec'] . ")" . $d['key'] . "[" . $d['wps'] . "]\n" . $d['lat'] . " " . $d['lon']]; $telegram->sendMessage($sendMsg); } unset($d); $sendMsg = ['chat_id' => $chatId, 'text' => "Страница " . $json['page']['current'] . "|" . $json['page']['count']]; $telegram->sendMessage($sendMsg); } else { $sendMsg = ['chat_id' => $chatId, 'text' => "Совпадений не найдено"]; $telegram->sendMessage($sendMsg); } } else { $sendMsg = ['chat_id' => $chatId, 'text' => HELP_FIND];
break; case "load_forums": $fetch = 0; if (isset($_REQUEST['fetch'])) { $fetch = $_REQUEST['fetch']; } loadD4Forums($fetch, true); break; case "send_post": if (isset($_REQUEST['body'])) { $body = $_REQUEST['body']; } if (isset($_REQUEST['postid'])) { $postid = $_REQUEST['postid']; } sendPost($postid, $body); break; case "verify_view": verifyView($view); break; case "load_forum": loadD4Forums(false, true); break; case "load_defender_forum": loadDefenderForums(); break; case "update_forum": updateForum(); break; case "fetch_disqus_forums": fetchDiscusForums();