Example #1
0
        public async Task highest_wickets_drawn_bowler(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            Crick_Luis crick = new Crick_Luis();

            if (m.getStatus().Equals("started"))
            {
                var team = m.getBowlTeam();
                var res  = m.getHighWBowler(team);
                await context.PostAsync($"{res.ToString()}");
            }
            else if (m.getStatus().Equals("notstarted"))
            {
                await context.PostAsync("The match is not yet Started");
            }
            else if (m.getStatus().Equals("completed"))
            {
                var aRes = m.getHighWBowler("a");
                var bRes = m.getHighWBowler("b");
                await context.PostAsync($"{aRes.ToString()} {Environment.NewLine + Environment.NewLine} {bRes.ToString()}");
            }
            else
            {
                await context.PostAsync(" No wickets fallen yet!!!");
            }

            context.Wait(MessageReceived);
        }
Example #2
0
        public async Task About(IDialogContext context, LuisResult result)
        {
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync("I am crick bot i can give you details of cricket matches and top news regarding the cricket matches..");

            context.Wait(MessageReceived);
        }
        public async Task Who_won_toss(IDialogContext context, LuisResult result)
        {
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync(".....won the toss");

            context.Wait(MessageReceived);
        }
Example #4
0
        public async Task Who_won_toss(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            string     z     = m.GetToss();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{z}");

            context.Wait(MessageReceived);
        }
Example #5
0
        public async Task captains(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            JArray     caps  = m.getCaptain();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{  caps[0].ToString()} {Environment.NewLine + Environment.NewLine}{ caps[1].ToString()}");

            context.Wait(MessageReceived);
        }
Example #6
0
        public async Task wicket_keeper(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            JArray     keeps = m.getKeeper();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{  keeps[0].ToString()} {Environment.NewLine + Environment.NewLine}{ keeps[1].ToString()}");

            context.Wait(MessageReceived);
        }
Example #7
0
        public async Task Place_of_match(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            string     z     = m.getMatchVenue();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{z} is the venue");

            context.Wait(MessageReceived);
        }
Example #8
0
        public async Task Opening_players(IDialogContext context, LuisResult result)
        {
            Methods    m       = new Methods();
            JArray     openers = m.getOpeners();
            Crick_Luis crick   = new Crick_Luis();
            await context.PostAsync($"{ openers[0].ToString() } and {openers[1].ToString()} are the opening players  and their patnership is {openers[2].ToString()}");

            context.Wait(MessageReceived);
        }
Example #9
0
        public async Task Man_of_the_match(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            string     man   = m.getManOfTheMatch();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{man.ToString()}");

            context.Wait(MessageReceived);
        }
Example #10
0
        public async Task Final_score(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            string     score = m.getCurrScore();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{score.ToString()} is the total score");

            context.Wait(MessageReceived);
        }
Example #11
0
        public async Task partnership(IDialogContext context, LuisResult result)
        {
            Methods m = new Methods();

            JArray     partners = m.getPatnership();
            Crick_Luis crick    = new Crick_Luis();
            await context.PostAsync($"{  partners[0].ToString() } Vs { partners[1].ToString()}  and their patnership is { partners[2].ToString()}");

            context.Wait(MessageReceived);
        }
Example #12
0
        public async Task Wickets_down(IDialogContext context, LuisResult result)
        {
            Methods    m       = new Methods();
            string     wickets = m.getWicketsDown();
            string     team    = m.getCurrentTeam();
            Crick_Luis crick   = new Crick_Luis();
            await context.PostAsync($"{team.ToString()} has  lost {wickets.ToString()} wickets");

            context.Wait(MessageReceived);
        }
Example #13
0
        public async Task No_of_four_team(IDialogContext context, LuisResult result)
        {
            Methods    m          = new Methods();
            string     four_score = m.getTeamFours();
            string     team       = m.getCurrentTeam();
            Crick_Luis crick      = new Crick_Luis();
            await context.PostAsync($" {team.ToString()} scored  {four_score.ToString()} fours till now ");

            context.Wait(MessageReceived);
        }
Example #14
0
        public async Task Who_won_match(IDialogContext context, LuisResult result)
        {
            Methods m           = new Methods();
            string  matchResult = m.getWhoWonTheMatch();

            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($"{matchResult.ToString()}");

            context.Wait(MessageReceived);
        }
Example #15
0
        public async Task completed_overs(IDialogContext context, LuisResult result)
        {
            Methods    m      = new Methods();
            string     extras = m.getOversTillNow();
            string     team   = m.getCurrentTeam();
            Crick_Luis crick  = new Crick_Luis();

            await context.PostAsync($"{team.ToString()} has  completed {extras.ToString()} overs till now ");

            context.Wait(MessageReceived);
        }
Example #16
0
        public async Task No_of_six_team(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            Crick_Luis crick = new Crick_Luis();

            if (m.getStatus().Equals("started"))
            {
                string six_score = m.getTeamSixes();
                string team      = m.getCurrentTeam();

                await context.PostAsync($" {team.ToString()} scored  {six_score.ToString()} sixes till now");
            }
            else
            {
                await context.PostAsync("No live data to display");
            }
            context.Wait(MessageReceived);
        }
Example #17
0
        public async Task Extras(IDialogContext context, LuisResult result)
        {
            Methods       m          = new Methods();
            JArray        extras     = m.getExtras();
            string        team       = m.getCurrentTeam();
            Crick_Luis    crick      = new Crick_Luis();
            List <string> extrasList = new List <string> {
            };

            extrasList.Add("Extras   : " + extras[0].ToString());
            extrasList.Add("Legbye   : " + extras[1].ToString());
            extrasList.Add("Bye      : " + extras[2].ToString());
            extrasList.Add("No Balls : " + extras[3].ToString());
            await context.PostAsync($"{team.ToString()} {Environment.NewLine + Environment.NewLine} ");

            await context.PostAsync($"{extrasList[0].ToString()} {Environment.NewLine + Environment.NewLine} {extrasList[1].ToString()}{Environment.NewLine + Environment.NewLine} {extrasList[2].ToString()}{Environment.NewLine + Environment.NewLine} {extrasList[3].ToString()}");

            context.Wait(MessageReceived);
        }
Example #18
0
        public async Task Current_bowling_players(IDialogContext context, LuisResult result)
        {
            Methods m = new Methods();

            if (m.getStatus().Equals("started"))
            {
                string     bowler = m.getCurrBowler();
                Crick_Luis crick  = new Crick_Luis();
                await context.PostAsync($"{bowler} is bowling now.");
            }
            else if (m.getStatus().Equals("notstarted"))
            {
                await context.PostAsync("As the match is not yet started !! ");
            }
            else if (m.getStatus().Equals("completed"))
            {
                await context.PostAsync("As the match is Completed !! There is no current bowler");
            }
            context.Wait(MessageReceived);
        }
Example #19
0
        public async Task Current_batting_players(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            Crick_Luis crick = new Crick_Luis();

            if (m.getStatus().Equals("started"))
            {
                //get their scores and balls faced
                JArray currPlayers = m.getCurrPlayers();
                await context.PostAsync($"{currPlayers[0].ToString()} and {currPlayers[1].ToString()}are the players batting now.");
            }
            else if (m.getStatus().Equals("notstarted"))
            {
                await context.PostAsync("As the match is not yet started !! There are no current players");
            }
            else if (m.getStatus().Equals("completed"))
            {
                await context.PostAsync("As the match is Completed !! There are no current players");
            }
            context.Wait(MessageReceived);
        }
Example #20
0
        public async Task No_of_four_player(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            Crick_Luis crick = new Crick_Luis();
            await context.PostAsync($" in luis {result.Query.ToString()}");

            if (m.getStatus().Equals("notstarted"))
            {
                await context.PostAsync("Strike rate can only be displayed for live matches");
            }
            else
            {
                JArray strike_rate = m.getPlayerFours(result.Query.ToString());
                if (strike_rate.Count() > 1)
                {
                    await context.PostAsync($" {strike_rate[0].ToString()} fours  are scored by {strike_rate[1].ToString()}");
                }
                else
                {
                    await context.PostAsync($" {strike_rate[0].ToString()}");
                }
            }
            context.Wait(MessageReceived);
        }
Example #21
0
        public async Task highest_scored_player_batting(IDialogContext context, LuisResult result)
        {
            Methods    m     = new Methods();
            Crick_Luis crick = new Crick_Luis();

            if (m.getStatus().Equals("started"))
            {
                var team = m.getBatTeam();
                var res  = m.getHighestBatsman(team);
                await context.PostAsync($"{res.ToString()}");
            }
            else if (m.getStatus().Equals("notstarted"))
            {
                await context.PostAsync("The match is not yet Started");
            }
            else if (m.getStatus().Equals("completed"))
            {
                var aRes = m.getHighestBatsman("a");
                var bRes = m.getHighestBatsman("b");
                await context.PostAsync($"{aRes.ToString()} {Environment.NewLine + Environment.NewLine} {bRes.ToString()}");
            }

            context.Wait(MessageReceived);
        }