public BotMessage GetResponse(ResponseContext context)
        {
            IReadOnlyDictionary <string, int> scores = context.Get <Scorebook>().GetScores();

            if (scores.Count > 0)
            {
                StringBuilder builder = new StringBuilder(context.Get <Phrasebook>().GetScoreboardHype());
                builder.Append("```");

                // add the scores to a list for sorting. while we do, figure out who has the longest name for the pseudo table formatting
                List <KeyValuePair <string, int> > sortedScores = new List <KeyValuePair <string, int> >();
                string longestName = string.Empty;

                foreach (string key in scores.Keys)
                {
                    KeyValuePair <string, int> newScore = new KeyValuePair <string, int>(context.UserNameCache[key], scores[key]);

                    if (newScore.Key.Length > longestName.Length)
                    {
                        longestName = newScore.Key;
                    }

                    sortedScores.Add(newScore);
                }
                sortedScores.Sort((x, y) => { return(y.Value.CompareTo(x.Value)); });

                foreach (KeyValuePair <string, int> userScore in sortedScores)
                {
                    StringBuilder nameString = new StringBuilder(userScore.Key);
                    while (nameString.Length < longestName.Length)
                    {
                        nameString.Append(" ");
                    }

                    builder.Append(nameString.ToString() + " | " + userScore.Value.ToString() + "\n");
                }

                builder.Append("```");

                return(new BotMessage()
                {
                    Text = builder.ToString()
                });
            }
            else
            {
                return(new BotMessage()
                {
                    Text = "Not a one-of-ya has scored yet. Come on, sleepyheads!"
                });
            }
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            var scores = context.Get<Scorebook>().GetScores();

            if (scores.Count <= 0)
                return new BotMessage {Text = "Ingen av er har en enda poäng ännu. Skärpning!"};

            var builder = new StringBuilder(context.Get<Phrasebook>().GetScoreboardHype());
            builder.Append("```");

            // add the scores to a list for sorting. while we do, figure out who has the longest name for the pseudo table formatting
            var sortedScores = new List<KeyValuePair<string, int>>();
            var longestName = string.Empty;

            foreach (var key in scores.Keys)
            {
                var newScore = new KeyValuePair<string, int>(context.UserNameCache[key], scores[key]);

                if (newScore.Key.Length > longestName.Length)
                {
                    longestName = newScore.Key;
                }

                sortedScores.Add(newScore);
            }
            sortedScores.Sort((x, y) => y.Value.CompareTo(x.Value));

            foreach (var userScore in sortedScores)
            {
                var nameString = new StringBuilder(userScore.Key);
                while (nameString.Length < longestName.Length)
                {
                    nameString.Append(" ");
                }

                builder.Append(nameString + " | " + userScore.Value + "\n");
            }

            builder.Append("```");

            return new BotMessage
            {
                Text = builder.ToString()
            };
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            IReadOnlyDictionary<string, int> scores = context.Get<Scorebook>().GetScores();

            if (scores.Count > 0) {
                StringBuilder builder = new StringBuilder(context.Get<Phrasebook>().GetScoreboardHype());
                builder.Append("```");

                // add the scores to a list for sorting. while we do, figure out who has the longest name for the pseudo table formatting
                List<KeyValuePair<string, int>> sortedScores = new List<KeyValuePair<string, int>>();
                string longestName = string.Empty;

                foreach (string key in scores.Keys) {
                    KeyValuePair<string, int> newScore = new KeyValuePair<string, int>(context.UserNameCache[key], scores[key]);
                    
                    if(newScore.Key.Length > longestName.Length) {
                        longestName = newScore.Key;
                    }

                    sortedScores.Add(newScore);
                }
                sortedScores.Sort((x, y) => { return y.Value.CompareTo(x.Value); });

                foreach(KeyValuePair<string, int> userScore in sortedScores)  {
                    StringBuilder nameString = new StringBuilder(userScore.Key);
                    while(nameString.Length < longestName.Length) {
                        nameString.Append(" ");
                    }

                    builder.Append(nameString.ToString() + " | " + userScore.Value.ToString() + "\n");
                }

                builder.Append("```");

                return new BotMessage() {
                    Text = builder.ToString()
                };
            }
            else { return new BotMessage() { Text = "Not a one-of-ya has scored yet. Come on, sleepyheads!" }; }
        }
        public void Execute(ResponseContext context)
        {
            var store = context.Get<IDocumentStore>();
            var jObject = JObject.Parse(context.Message.RawData);

            using (var session = store.OpenSession())
            {
                session.Store(context.Message);
                var metadata = session.Advanced.GetMetadataFor(context.Message);
                metadata.Add(Keys.RavenDB.Metadata.Created,DateTime.Now);
                metadata.Add(Keys.RavenDB.Metadata.TimeStamp, jObject[Keys.Slack.MessageJson.TimeStamp].Value<string>());
                session.SaveChanges();
            }
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            var bot = context.Get<Bot>();

            var sb = new StringBuilder();
            sb.AppendLine("Här är en lista över mina nuvarande, exponerade, funktioner.");

            foreach (var exposedCapability in bot.Responders.OfType<IExposedCapability>())
            {
                sb.AppendLine("*{0}*".With(exposedCapability.Info.Usage));
                sb.AppendLine(">{0}".With(exposedCapability.Info.Explatation));
            }

            return new BotMessage{Text = sb.ToString()};
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            var connectedSince = context.Get<Bot>().ConnectedSince.Value;
            var timeSpan = DateTime.Now - connectedSince;

            return new BotMessage { Text = "Jag har varit uppe sedan {0} {1}. \n{2} dagar\n{3} timmar\n{4} minuter\n{5} sekunder"
                                            .With(
                                                connectedSince.ToShortDateString(),
                                                connectedSince.ToLongTimeString(),
                                                timeSpan.Days,
                                                timeSpan.Hours,
                                                timeSpan.Minutes,
                                                timeSpan.Seconds
                                            )};
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            string data = string.Empty;
            if (LastDataGrab != null && LastDataGrab.Value > DateTime.Now.AddMinutes(-10)) {
                data = LastData;
            }
            else {
                NoobWebClient client = new NoobWebClient();
                data = client.GetResponse("http://api.wunderground.com/api/" + WundergroundAPIKey + "/conditions/q/TN/Nashville.json", RequestMethod.Get).GetAwaiter().GetResult();
                LastData = data;
                LastDataGrab = DateTime.Now;
            }
            
            JObject jData = JObject.Parse(data);
            if (jData["current_observation"] != null) {
                string tempString = jData["current_observation"]["temp_f"].Value<string>();
                double temp = double.Parse(tempString);

                return new BotMessage() { Text = "It's about " + Math.Round(temp).ToString() + "° out, and it's " + jData["current_observation"]["weather"].Value<string>().ToLower() + ". " + context.Get<Phrasebook>().GetWeatherAnalysis(temp) + "\n\nIf you wanna see more. head over to " + jData["current_observation"]["forecast_url"].Value<string>() + " - my girlfriend DonnaBot works over there!" };
            }
            else {
                return new BotMessage() { Text = "Aww, nuts. My weatherbot gal-pal ain't around. Try 'gin later - she's prolly just fixin' her makeup." };
            }
        }
        public override BotMessage GetResponse(ResponseContext context)
        {
            Context = context;

            var invMan = new InventoryManager(Context);
            var userInv = invMan.GetUserInventory();

            if(userInv.BEK < GameCost)
                return new BotMessage{Text = PhraseBook.GetInsufficientFundsFormat().With(GameCost)};

            userInv.BEK -= GameCost;
            invMan.Save(userInv);

            var game = new Game();
            var score = game.Play();

            decimal payout;
            int outcome;
            using (var session = DocumentStore.OpenSession())
            {
                var pot = session.Query<MoneyPot>().FirstOrDefault(x => x.Name == GameKey) ?? new MoneyPot { Name = GameKey };
                pot.BEK += Math.Round(GameCost * PotPercentage,2);

                var highScore = session.Query<HighScore>().FirstOrDefault(x => x.Name == GameKey) ?? new HighScore { Name = GameKey };
                outcome = highScore.TryAddNewScore(new Score { UserId = userInv.UserId, Value = score });

                if (outcome < 1)
                {
                    session.Store(pot);
                    session.SaveChanges();
                    return new BotMessage { Text = PhraseBook.GetDidntMakeHighScoreFormat().With(score) };
                }

                payout = Math.Round(PayoutDictionary[outcome] * pot.BEK,2)+GameCost;
                pot.BEK -= payout;
                userInv.BEK += payout;

                session.Store(pot);
                session.Store(highScore);
                session.SaveChanges();
            }

            invMan.Save(userInv);

            var channelNames = context.Get<Dictionary<string, string>>(Keys.StaticContextKeys.ChannelsNameCache);
            SecondaryMessageResponder.Message = new BotMessage
            {
                ChatHub = new SlackChatHub{ID = channelNames.First(x=>x.Value=="general").Key},
                Text = PhraseBook.GetNewHighscoreFormat().With(GameKey, context.UserNameCache[context.Message.User.ID], outcome)
            };

            return new BotMessage
            {
                Text ="{0} {1}".With(
                        PhraseBook.GetPotPayoutFormat().With(score, outcome, payout),
                        PhraseBook.GetExclamation())
            };
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            // perform scoring
            List <ScoringResult> scoringResults = new List <ScoringResult>();

            // bet you anything there's a better way to do this
            Match match = Regex.Match(context.Message.Text, SCORE_REGEX);

            for (int i = 0; i < match.Groups["formattedUserID"].Captures.Count; i++)
            {
                scoringResults.Add(new ScoringResult()
                {
                    FormattedUserID = match.Groups["formattedUserID"].Captures[i].Value,
                    IsNewScorer     = !this.Scorebook.HasUserScored(match.Groups["userID"].Captures[i].Value),
                    IsValidScorer   = (match.Groups["userID"].Captures[i].Value != context.Message.User.ID),
                    UserID          = match.Groups["userID"].Captures[i].Value
                });
            }

            var newScorers   = scoringResults.Where(r => r.IsNewScorer).Select(r => r.UserID).ToList();
            var scoringUsers = scoringResults.Where(r => r.IsValidScorer).Select(r => r.UserID).ToList();
            var allUsers     = scoringResults.Select(r => r.UserID).ToList();

            // score the users and shove the scorebook into the context for use by the ScoreboardRequestResponder
            Scorebook.ScoreUsers(scoringUsers, 1);

            var phrasebook      = context.Get <Phrasebook>();
            var responseBuilder = new StringBuilder();

            if (allUsers.Contains(context.Message.User.ID))
            {
                responseBuilder.Append(string.Format("Bless your heart, {0}. You can't score yourself - what kinda game would that be?! Y'all, {0} is cute, but I think he/she might be dumb as a box o' rocks.\n\n", context.Message.User.FormattedUserID));
            }

            if (scoringUsers.Count() > 0)
            {
                if (responseBuilder.Length > 0)
                {
                    responseBuilder.Append("Anyway... ");
                }

                if (scoringUsers.Count() == 1)
                {
                    if (scoringUsers[0] == context.BotUserID)
                    {
                        int margieScore = Scorebook.GetUserScore(context.BotUserID);
                        responseBuilder.Append(string.Format("Awwww, aren't you a sweetie! *[blushes]* If you insist. Now I have {0} point{1}.\n\n", margieScore, margieScore == 1 ? string.Empty : "s"));
                    }
                    else if (newScorers.Contains(scoringUsers[0]))
                    {
                        responseBuilder.Append(string.Format("A new challenger appears, y'all! {0} is on the board with a point. {1}", scoringResults.Where(r => r.UserID == scoringUsers[0]).First().FormattedUserID, phrasebook.GetAffirmation()));
                    }
                    else
                    {
                        ScoringResult scoredUser = scoringResults.Where(r => r.UserID == scoringUsers[0]).First();

                        responseBuilder.Append(
                            string.Format(
                                "{0} {1} just scored a point. {2} {1}, your score is now {3}.",
                                phrasebook.GetExclamation(),
                                scoredUser.FormattedUserID,
                                phrasebook.GetAffirmation(),
                                Scorebook.GetUserScore(scoredUser.UserID)
                                )
                            );
                    }
                }
                else
                {
                    responseBuilder.Append("There's points all over this joint, y'all. ");
                    IList <ScoringResult> scoringUserResults = scoringResults.Where(r => r.IsValidScorer).ToList();

                    if (scoringUserResults.Count == 2)
                    {
                        responseBuilder.Append(
                            string.Format(
                                "{1} and {2} each just scored a point. {3}",
                                phrasebook.GetExclamation(),
                                scoringUserResults[0].FormattedUserID,
                                scoringUserResults[1].FormattedUserID,
                                phrasebook.GetAffirmation()
                                )
                            );
                    }
                    else
                    {
                        for (int i = 0; i < scoringUserResults.Count; i++)
                        {
                            responseBuilder.Append(scoringUserResults[i].FormattedUserID);

                            if (i < scoringResults.Count - 2)
                            {
                                responseBuilder.Append(", ");
                            }
                            else if (i == scoringResults.Count - 2)
                            {
                                responseBuilder.Append(", and ");
                            }
                        }

                        responseBuilder.Append(" each just scored a point. " + phrasebook.GetExclamation());
                    }
                }
            }

            return(new BotMessage()
            {
                Text = responseBuilder.ToString().Trim()
            });
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            string city          = Regex.Match(context.Message.Text, WEATHER_LOCATIONTERM_REGEX).Groups["cityTerm"].Value;
            string state         = Regex.Match(context.Message.Text, WEATHER_LOCATIONTERM_REGEX).Groups["stateTerm"].Value;
            string weatherReport = string.Empty;

            if (!string.IsNullOrEmpty(city) && !string.IsNullOrEmpty(state))
            {
                if (WeatherLookupCache.ContainsKey(city + state))
                {
                    WeatherLookupCache.TryGetValue(city + state, out weatherReport);
                }

                JObject jData = null;

                if (!string.IsNullOrEmpty(weatherReport))
                {
                    jData = JObject.Parse(weatherReport);

                    DateTime weatherReportAgeDateTimeStamp = jData["current_observation"]["local_time_rfc822"].Value <DateTime>();

                    if (weatherReportAgeDateTimeStamp < DateTime.Now.AddMinutes(-10))
                    {
                        WeatherLookupCache.Remove(city + state);

                        weatherReport = GetWeatherReport(city, state);

                        WeatherLookupCache.Add(city + state, weatherReport);
                    }
                }
                else
                {
                    weatherReport = GetWeatherReport(city, state);

                    WeatherLookupCache.Add(city + state, weatherReport);
                }

                if (jData == null)
                {
                    jData = JObject.Parse(weatherReport);
                }

                if (jData["current_observation"] != null)
                {
                    string tempString = jData["current_observation"]["temp_f"].Value <string>();
                    double temp       = double.Parse(tempString);

                    return(new BotMessage()
                    {
                        Text = "It's about " + Math.Round(temp).ToString() + "° out, and it's " + jData["current_observation"]["weather"].Value <string>().ToLower() + ". " + context.Get <Phrasebook>().GetWeatherAnalysis(temp) + "\n\nIf you wanna see more. head over to " + jData["current_observation"]["forecast_url"].Value <string>() + " - my girlfriend DonnaBot works over there!"
                    });
                }
                else
                {
                    return(new BotMessage()
                    {
                        Text = "Aww, nuts. My weatherbot gal-pal ain't around. Try 'gin later - she's prolly just fixin' her makeup."
                    });
                }
            }
            else
            {
                // Default respone when request is not both a city and state
                return(new BotMessage()
                {
                    Text = "Shucks, hun. I don't think I understood. Can you try again? Make sure to tell me what city and state you want to hear about the weather from!"
                });
            }
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            string data = string.Empty;

            if (LastDataGrab != null && LastDataGrab.Value > DateTime.Now.AddMinutes(-10))
            {
                data = LastData;
            }
            else
            {
                NoobWebClient client = new NoobWebClient();
                data         = client.GetResponse("http://api.wunderground.com/api/" + WundergroundAPIKey + "/conditions/q/TN/Nashville.json", RequestMethod.Get).GetAwaiter().GetResult();
                LastData     = data;
                LastDataGrab = DateTime.Now;
            }

            JObject jData = JObject.Parse(data);

            if (jData["current_observation"] != null)
            {
                string tempString = jData["current_observation"]["temp_f"].Value <string>();
                double temp       = double.Parse(tempString);

                return(new BotMessage()
                {
                    Text = "It's about " + Math.Round(temp).ToString() + "° out, and it's " + jData["current_observation"]["weather"].Value <string>().ToLower() + ". " + context.Get <Phrasebook>().GetWeatherAnalysis(temp) + "\n\nIf you wanna see more. head over to " + jData["current_observation"]["forecast_url"].Value <string>() + " - my girlfriend DonnaBot works over there!"
                });
            }
            else
            {
                return(new BotMessage()
                {
                    Text = "Aww, nuts. My weatherbot gal-pal ain't around. Try 'gin later - she's prolly just fixin' her makeup."
                });
            }
        }
Exemple #12
0
        public BotMessage GetResponse(ResponseContext context)
        {
            // perform scoring
            var scoringResults = new List<ScoringResult>();

            // bet you anything there's a better way to do this
            var match = Regex.Match(context.Message.Text, ScoreRegex);
            for (var i = 0; i < match.Groups["formattedUserID"].Captures.Count; i++)
            {
                scoringResults.Add(new ScoringResult
                {
                    FormattedUserID = match.Groups["formattedUserID"].Captures[i].Value,
                    IsNewScorer = !Scorebook.HasUserScored(match.Groups["userID"].Captures[i].Value),
                    IsValidScorer = (match.Groups["userID"].Captures[i].Value != context.Message.User.ID),
                    UserID = match.Groups["userID"].Captures[i].Value
                });
            }

            IList<string> newScorers = scoringResults.Where(r => r.IsNewScorer).Select(r => r.UserID).ToList();
            IList<string> scoringUsers = scoringResults.Where(r => r.IsValidScorer).Select(r => r.UserID).ToList();
            IList<string> allUsers = scoringResults.Select(r => r.UserID).ToList();

            // score the users and shove the scorebook into the context for use by the ScoreboardRequestResponder
            Scorebook.ScoreUsers(scoringUsers, 1);

            var phrasebook = context.Get<Phrasebook>();
            var responseBuilder = new StringBuilder();

            if (allUsers.Contains(context.Message.User.ID))
            {
                responseBuilder.Append( //TODO in i frasboken med knasiga utryck
                    "@{0}. Du kan inte ge dig själv poäng - vad skulle det vara för ett spel?. {0} är ju för rolig, men jag undrar om alla indianer ror åt samma håll.\n\n"
                        .With(context.Message.User.FormattedUserID));
            }

            if (scoringUsers.Any())
            {
                if (responseBuilder.Length > 0)
                {
                    responseBuilder.Append("Hur som... ");
                }

                if (scoringUsers.Count() == 1)
                {
                    if (scoringUsers[0] == context.BotUserID)
                    {
                        int margieScore = Scorebook.GetUserScore(context.BotUserID);
                        responseBuilder.Append(
                            "{0} Då har jag {1} poäng.\n\n"
                                .With(phrasebook.GetThankYou(), margieScore));
                    }
                    else if (newScorers.Contains(scoringUsers[0]))
                    {
                        responseBuilder.Append(
                            "En ny deltagare! {0} är nu med på listan med en poäng. {1}"
                                .With(
                                        scoringResults.First(r => r.UserID == scoringUsers[0]).FormattedUserID,
                                        phrasebook.GetExclamation())
                                    );
                    }
                    else
                    {
                        var scoredUser = scoringResults.First(r => r.UserID == scoringUsers[0]);

                        responseBuilder.Append(
                            "{0} {1} fick just en poäng. {1}, du har nu {2}."
                            .With(
                                    phrasebook.GetExclamation(),
                                    scoredUser.FormattedUserID,
                                    Scorebook.GetUserScore(scoredUser.UserID)
                                )
                            );
                    }
                }
                else
                {
                    responseBuilder.Append("Poäng lite här och var.");
                    IList<ScoringResult> scoringUserResults = scoringResults.Where(r => r.IsValidScorer).ToList();

                    if (scoringUserResults.Count == 2)
                    {
                        responseBuilder.Append(
                            "{0} och {1} fick varsin poäng. {2}"
                            .With(
                                    scoringUserResults[0].FormattedUserID,
                                    scoringUserResults[1].FormattedUserID,
                                    phrasebook.GetMutedExclamation()
                                )
                            );
                    }
                    else
                    {
                        for (int i = 0; i < scoringUserResults.Count; i++)
                        {
                            responseBuilder.Append(scoringUserResults[i].FormattedUserID);

                            if (i < scoringResults.Count - 2)
                            {
                                responseBuilder.Append(", ");
                            }
                            else if (i == scoringResults.Count - 2)
                            {
                                responseBuilder.Append(", och ");
                            }
                        }

                        responseBuilder.Append(" fick just en poäng var. " + phrasebook.GetExclamation());
                    }
                }
            }

            var invMan = new InventoryManager(context);

            var sourceUserInv = invMan.GetUserInventory();
            sourceUserInv.BEK += SourceCashPayout;

            var userInventories = new List<Inventory>{sourceUserInv};

            foreach (var userId in scoringUsers)
            {
                var targetInv = invMan.GetUserInventory(userId);
                targetInv.BEK += TargetCashPayout;
                userInventories.Add(targetInv);
            }

            invMan.Save(userInventories);

            return new BotMessage {Text = responseBuilder.ToString().Trim()};
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            string city = Regex.Match(context.Message.Text, WEATHER_LOCATIONTERM_REGEX).Groups["cityTerm"].Value;
            string state = Regex.Match(context.Message.Text, WEATHER_LOCATIONTERM_REGEX).Groups["stateTerm"].Value;
            string weatherReport = string.Empty;

            if (!string.IsNullOrEmpty(city) && !string.IsNullOrEmpty(state))
            {
                if (WeatherLookupCache.ContainsKey(city + state))
                {
                    WeatherLookupCache.TryGetValue(city + state, out weatherReport);
                }

                JObject jData = null;

                if (!string.IsNullOrEmpty(weatherReport))
                {
                    jData = JObject.Parse(weatherReport);

                    DateTime weatherReportAgeDateTimeStamp = jData["current_observation"]["local_time_rfc822"].Value<DateTime>();

                    if (weatherReportAgeDateTimeStamp < DateTime.Now.AddMinutes(-10))
                    {
                        WeatherLookupCache.Remove(city + state);

                        weatherReport = GetWeatherReport(city, state);

                        WeatherLookupCache.Add(city + state, weatherReport);
                    }
                }
                else
                {
                    weatherReport = GetWeatherReport(city, state);

                    WeatherLookupCache.Add(city + state, weatherReport);
                }

                if(jData == null)
                {
                    jData = JObject.Parse(weatherReport);
                }

                if (jData["current_observation"] != null)
                {
                    string tempString = jData["current_observation"]["temp_f"].Value<string>();
                    double temp = double.Parse(tempString);

                    return new BotMessage() { Text = "It's about " + Math.Round(temp).ToString() + "° out, and it's " + jData["current_observation"]["weather"].Value<string>().ToLower() + ". " + context.Get<Phrasebook>().GetWeatherAnalysis(temp) + "\n\nIf you wanna see more. head over to " + jData["current_observation"]["forecast_url"].Value<string>() + " - my girlfriend DonnaBot works over there!" };
                }
                else {
                    return new BotMessage() { Text = "Aww, nuts. My weatherbot gal-pal ain't around. Try 'gin later - she's prolly just fixin' her makeup." };
                }
            }
            else
            {
                // Default respone when request is not both a city and state
                return new BotMessage() { Text = "Shucks, hun. I don't think I understood. Can you try again? Make sure to tell me what city and state you want to hear about the weather from!" };
            }
        }
        public BotMessage GetResponse(ResponseContext context)
        {
            // perform scoring
            List<ScoringResult> scoringResults = new List<ScoringResult>();

            // bet you anything there's a better way to do this
            Match match = Regex.Match(context.Message.Text, SCORE_REGEX);
            for (int i = 0; i < match.Groups["formattedUserID"].Captures.Count; i++) {
                scoringResults.Add(new ScoringResult() {
                    FormattedUserID = match.Groups["formattedUserID"].Captures[i].Value,
                    IsNewScorer = !this.Scorebook.HasUserScored(match.Groups["userID"].Captures[i].Value),
                    IsValidScorer = (match.Groups["userID"].Captures[i].Value != context.Message.User.ID),
                    UserID = match.Groups["userID"].Captures[i].Value
                });
            }

            IList<string> newScorers = scoringResults.Where(r => r.IsNewScorer).Select(r => r.UserID).ToList();
            IList<string> scoringUsers = scoringResults.Where(r => r.IsValidScorer).Select(r => r.UserID).ToList();
            IList<string> allUsers = scoringResults.Select(r => r.UserID).ToList();

            // score the users and shove the scorebook into the context for use by the ScoreboardRequestResponder
            Scorebook.ScoreUsers(scoringUsers, 1);

            Phrasebook phrasebook = context.Get<Phrasebook>();
            StringBuilder responseBuilder = new StringBuilder();

            if (allUsers.Contains(context.Message.User.ID)) {
                responseBuilder.Append(string.Format("Bless your heart, {0}. You can't score yourself - what kinda game would that be?! Y'all, {0} is cute, but I think he/she might be dumb as a box o' rocks.\n\n", context.Message.User.FormattedUserID));
            }
            
            if(scoringUsers.Count() > 0) {
                if(responseBuilder.Length > 0) {
                    responseBuilder.Append("Anyway... ");
                }

                if(scoringUsers.Count() == 1) {
                    if(scoringUsers[0] == context.BotUserID) {
                        int margieScore = Scorebook.GetUserScore(context.BotUserID);
                        responseBuilder.Append(string.Format("Awwww, aren't you a sweetie! *[blushes]* If you insist. Now I have {0} point{1}.\n\n", margieScore, margieScore == 1 ? string.Empty : "s"));
                    }
                    else if(newScorers.Contains(scoringUsers[0])) {
                        responseBuilder.Append(string.Format("A new challenger appears, y'all! {0} is on the board with a point. {1}", scoringResults.Where(r => r.UserID == scoringUsers[0]).First().FormattedUserID, phrasebook.GetAffirmation()));
                    }
                    else {
                        ScoringResult scoredUser = scoringResults.Where(r => r.UserID == scoringUsers[0]).First();

                        responseBuilder.Append(
                            string.Format(
                                "{0} {1} just scored a point. {2} {1}, your score is now {3}.",
                                phrasebook.GetExclamation(),
                                scoredUser.FormattedUserID,
                                phrasebook.GetAffirmation(),
                                Scorebook.GetUserScore(scoredUser.UserID)
                            )
                        );
                    }
                }
                else {
                    responseBuilder.Append("There's points all over this joint, y'all. ");
                    IList<ScoringResult> scoringUserResults = scoringResults.Where(r => r.IsValidScorer).ToList();

                    if (scoringUserResults.Count == 2) {
                        responseBuilder.Append(
                            string.Format(
                                "{1} and {2} each just scored a point. {3}",
                                phrasebook.GetExclamation(),
                                scoringUserResults[0].FormattedUserID,
                                scoringUserResults[1].FormattedUserID,
                                phrasebook.GetAffirmation()
                            )
                        );
                    }
                    else {
                        for (int i = 0; i < scoringUserResults.Count; i++) {
                            responseBuilder.Append(scoringUserResults[i].FormattedUserID);

                            if (i < scoringResults.Count - 2) {
                                responseBuilder.Append(", ");
                            }
                            else if(i == scoringResults.Count - 2) {
                                responseBuilder.Append(", and ");
                            }
                        }

                        responseBuilder.Append(" each just scored a point. " + phrasebook.GetExclamation());

                    }
                }
            }

            return new BotMessage() { Text = responseBuilder.ToString().Trim() };
        }