<?php
/**
 * Created by PhpStorm.
 * User: chendeben
 * Date: 2017/12/6
 * Time: 11:50
 */
namespace Heanup\App\Api\Controller;

use Heanup\App\Api\Package\Database\File;
use Heanup\App\Api\Package\Database\Hash;
use Heanup\App\Api\Controller;
use Heanup\Frame\Logger;
use Heanup\Library\Sphinx;

class Telegram extends Controller
{
    public function  main(){
        $telegram=new \Telegram("532191649:AAGxdBNPQGrHo0Ralqpg_sSZFrJJwCh0KIk");
        $msg=$telegram->Text();
//        Logger::setLog("cdb@meitu.com",json_encode($msg));
        file_put_contents("/data/wwwlogs/log.txt", json_encode($msg),FILE_APPEND);
        if ($msg=="/ss5"){
            $chat_id = $telegram->ChatID();
            $content = array('chat_id' => $chat_id, 'text' => '最新的官网临时地址是【 https://www.ss5.xyz/ 】');
            $telegram->sendMessage($content);
        }else{
            $chat_id = $telegram->ChatID();
            $content = array('chat_id' => $chat_id, 'text' => '最新的官网临时地址是【 https://www.ss5.xyz/ 】');
            $telegram->sendMessage($content);
        }
    }
}