Пример #1
0
        public void AnalyzeText(string sText)
        {
            JObject rss = new JObject(new JProperty("text", sText));

            Tools.HttpReturn ret = Tools.HttpRequest(user.url_recast + "/v2/request", "POST", Encoding.UTF8.GetBytes(rss.ToString()), 0, "application/json", null, null, developer_token, "Token");
            _json = ret._json.ToString();
        }
Пример #2
0
 public void Delete(Bot oBot, string sIntentId)
 {
     if (!string.IsNullOrEmpty(sIntentId))
     {
         Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + sIntentId + "/expressions/" + id, "DELETE", null, 0, null, null, null, oBot.developer_token, "Token");
         _json = ret._json.ToString();
     }
 }
Пример #3
0
 public void Update(Bot oBot, string sIntentId)
 {
     if (!string.IsNullOrEmpty(sIntentId))
     {
         Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + sIntentId + "/expressions/" + id, "PUT", Encoding.UTF8.GetBytes(GetJson().ToString()), 0, "application/json", null, null, oBot.developer_token, "Token");
         _json = ret._json.ToString();
         Load(ret._json.results);
     }
 }
Пример #4
0
        public static Bot Get(User oUser, string sSlug, string sDevToken)
        {
            Tools.HttpReturn ret = Tools.HttpRequest(oUser.uri + "/bots/" + sSlug, "GET", null, 0, null, null, null, sDevToken, "Token");
            Bot oBot             = new Bot(oUser, ret._json.results);

            oBot._message = ret._json.message;

            return(oBot);
        }
Пример #5
0
        public void Update(Bot oBot)
        {
            Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + id, "PUT", Encoding.UTF8.GetBytes(GetJson().ToString()), 0, "application/json", null, null, oBot.developer_token, "Token");
            _json = ret._json.ToString();

            var exps = (JArray)ret._json.results;

            foreach (var elem in exps)
            {
                expressions.Add(new Expression(elem));
            }
        }
Пример #6
0
        public void GetListExpressions(Bot oBot)
        {
            Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + id + "/expressions", "GET", null, 0, null, null, null, oBot.developer_token, "Token");
            _json = ret._json.ToString();
            LoadExpressions(ret._json.results);

            /*var exps = (JArray)ret._json.results;
             * foreach (var elem in exps)
             * {
             *  expressions.Add(new Expression(elem));
             * }*/
        }
Пример #7
0
 public void Delete(Bot oBot)
 {
     Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + id, "DELETE", null, 0, null, null, null, oBot.developer_token, "Token");
 }
Пример #8
0
 public void BulkCreateExpressions(Bot oBot)
 {
     Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + id + "/expressions/bulk_create", "POST", Encoding.UTF8.GetBytes(GetJson(false).ToString()), 0, "application/json", null, null, oBot.developer_token, "Token");
     _json = ret._json.ToString();
 }
Пример #9
0
 public void Get(Bot oBot)
 {
     Tools.HttpReturn ret = Tools.HttpRequest(oBot.uri + "/intents/" + id, "GET", null, 0, null, null, null, oBot.developer_token, "Token");
     _json = ret._json.ToString();
     Load(ret._json);
 }
Пример #10
0
 public void Update()
 {
     Tools.HttpReturn ret = Tools.HttpRequest(uri, "PUT", Encoding.UTF8.GetBytes(GetJson().ToString()), 0, "application/json", null, null, developer_token, "Token");
     _json = ret._json.ToString();
     Load(ret._json.results);
 }
Пример #11
0
 public void Converse(Bot oBot, string sText, string sConvToken = null)
 {
     Tools.HttpReturn ret = Tools.HttpRequest(oBot.user.url_recast + "/v2/converse", "POST", Encoding.UTF8.GetBytes(GetJson().ToString()), 0, "application/json", null, null, oBot.developer_token, "Token");
     _json = ret._json.ToString();
     Load(ret._json);
 }