signed

QiShunwang

“诚信为本、客户至上”

Autojs对接图灵机器人

2021/5/15 1:05:42   来源:
/**
 *   QQ : 1433668136
 *   接 手机,模拟器,云手机 脚本定制   
 *
 * @param {*} text 对话消息
 * @param {*} apikey 图灵机器人秘钥
 * @returns 
 */

function turing(text, apikey) {
    http.__okhttp__.setTimeout(10*1000);
    try {
        let res = http.postJson("http://openapi.tuling123.com/openapi/api/v2", {
            "reqType": 0,
            "perception": {
                "inputText": {
                    "text": text,
                },
            },
            "userInfo": {
                "apiKey": apikey,
                "userId": ""
            }
        }).body.json();
        log(res);
        let res = res['results'][0]['values']['text'];
        return res;
    } catch (e) {
        return false;
    }
}