コード例 #1
0
ファイル: requestYX.php プロジェクト: ircoco/setin.cn
            $robot = new Robot($keyword);
            $rst = $robot->getReply();
            if (is_array($rst)) {
                $reply = $yixin->makeNews($rst);
            } else {
                $reply = $yixin->makeText($rst);
            }
        } elseif ($state['state'] == '5') {
            $weather = new Weather($keyword);
            $reply = $yixin->makeText($weather->getWeatherDetail());
        } elseif ($state['state'] == '6') {
            $youdao = new YouDaoTrans($keyword);
            $reply = $yixin->makeText($youdao->getTransContent());
        } elseif ($state['state'] == '7') {
            $mobile = new Mobile($keyword);
            $reply = $yixin->makeText($mobile->getMobileLocation());
        } elseif ($state['state'] == 'hzj') {
            $smsbomb = new Smsbomb($keyword);
            $reply = $yixin->makeText($smsbomb->get());
        } elseif ($state['state'] == '100') {
            $content = $yixin->msg[FromUserName] . "\n" . $yixin->msg[ToUserName];
            $reply = $yixin->makeText($content);
        } else {
            $reply = $yixin->makeText(cons::$WELCOME_STR);
        }
    }
} elseif ($type === 'location') {
    // 用户发送的是位置信息 稍后的文章中会处理
} elseif ($type === 'image') {
    // 用户发送的是图片 稍后的文章中会处理
} elseif ($type === 'voice') {