<?php require '../wp-load.php'; echo '<pre>'; // var_dump(wp_get_schedules()); // var_dump(_get_cron_array()); $shadowsocks = new meShadowsocks(); $telegram = new meTelegram(); // $content = $telegram->getUpdates (); $update = file_get_contents("php://input"); if (empty($update)) { $shadowsocks->ss(); // var_dump ( $shadowsocks->ss ); exit; } $update = json_decode($update, true); // $update = $update ['result'] ['0']; if (!$update) { $telegram->debug('消息内容为空,发送出错'); exit; } if (isset($update["message"])) { if ('bot_command' == $update['message']['entities']['0']['type'] && '/start' == substr($update["message"]['text'], $update["message"]['entities']['0']['offset'], $update["message"]['entities']['0']['length'])) { $text = '发送任意消息获取一个随机的服务器,为了支持网上免费服务器,大家可以进去看看,点点广告啥的,就算自己不能支持,让广告商赞助也不错,是这个道理吧🤔。'; $text .= '使用的时候复制整条消息直接导入就好了,Shadowsocks 客户端会自动识别'; $temp = $telegram->send('sendMessage', array('chat_id' => $update["message"]["chat"]['id'], 'text' => $text)); exit; } if ('bot_command' == $update['message']['entities']['0']['type'] && '/help' == substr($update["message"]['text'], $update["message"]['entities']['0']['offset'], $update["message"]['entities']['0']['length'])) { $text = '使用的时候复制整条消息直接导入就好了,Shadowsocks 客户端会自动识别,/help 加内容可以发消息给作者,有啥子事就说。'; $temp = $telegram->send('sendMessage', array('chat_id' => $update["message"]["chat"]['id'], 'text' => $text));