Example #1
0
        // get Data from MAtch API
        public JObject getData()
        {
            ResMethods  rs           = new ResMethods();
            String      Endpoint     = "https://rest.cricketapi.com/rest/v2/match/" + match_key + "/?access_token=" + rs.getAuth_Token();
            String      res_str_json = res.MakeRequest(Endpoint);
            RootObject1 ro1          = JsonConvert.DeserializeObject <RootObject1>(res_str_json);
            var         schedule_str = ro1.data.ToString();

            return(JObject.Parse(schedule_str));
        }
Example #2
0
        public async Task DisplayMatchesCard(IDialogContext context, IAwaitable <string> result)
        {
            var selectedCard = await result;
            await context.PostAsync($"{selectedCard.ToString()}");

            ResMethods rm = new ResMethods();
            string     k  = rm.getMatch_Key(selectedCard);

            if (k.Equals("none"))
            {
                await context.PostAsync($"Can u select the match again.. ");
            }
            else
            {
                Methods m = new Methods();
                m.setMatchKey(k.ToString());
                await context.PostAsync($"{selectedCard}U can ask anything about this match > ");
            }
        }
Example #3
0
 public async virtual Task RecentMatches_List(IDialogContext context)
 {
     try
     {
         ResMethods rm = new ResMethods();
         matches_list = rm.getAllRecentList();
         // promt (list) displays the recent matches
         PromptDialog.Choice <string>(
             context,
             this.DisplayMatchesCard,
             this.matches_list,
             "Here are the Recent Matches :",
             "Ooops, what you wrote is not a valid option, please try again",
             3,
             PromptStyle.PerLine);
     }
     catch (Exception e)
     {
         await context.PostAsync("error" + e.ToString());
     }
 }