protected override void ProcessMatch(System.Text.RegularExpressions.Match match, Models.ChatMessage message, Bot bot) { var client = new NGitHub.GitHubClient(); var org = new NGitHub.Services.OrganizationService(client); org.GetMembersAsync("NuGet", members => { bot.Say(string.Format("@{0}, Here are the people listed on github as part of the NuGet team. {1}. Why not get involved yourself? http://docs.nuget.org/docs/contribute/contributing-to-nuget", message.FromUser, String.Join(", ", members.Select(m => String.Format("{0} ({1})", m.Name, m.Login)))), message.Room); }, e => { bot.Say(String.Format("I'm affriad I can't do that {0}. {1}", message.FromUser, e.ToString()), message.Room); }); }
protected override void ProcessMatch(System.Text.RegularExpressions.Match match, Models.ChatMessage message, Bot bot) { var client = new NGitHub.GitHubClient(); var org = new NGitHub.Services.OrganizationService(client); org.GetMembersAsync("NuGet", members => { bot.Say(string.Format("@{0}, Here are the people listed on github as part of the NuGet team. {1}. Why not get involved yourself? http://docs.nuget.org/docs/contribute/contributing-to-nuget", message.FromUser, String.Join(", ", members.Select(m => String.Format("{0} ({1})", m.Name, m.Login)))), message.Room); }, e => { bot.Say(String.Format("I'm affriad I can't do that {0}. {1}", message.FromUser, e.ToString()), message.Room); }); }
protected override void ProcessMatch(Match match, ChatMessage message, Bot bot) { NGitHub.GitHubClient client = new NGitHub.GitHubClient(); client.Issues.GetIssuesAsync("nuget", match.Groups[2].Value, NGitHub.Models.State.Open, issues => { string issueCount = ""; if (issues.Any()) { issueCount = "@{0}, {1} has {2} issues."; } else { issueCount = "@{0}, {1} has no issues, this has to be wrong. I know that code isn't perfect."; } bot.Say(string.Format(issueCount, message.FromUser, match.Groups[2], issues.Count()), message.Room); }, e => { bot.Say(String.Format("I'm affriad I can't do that {0}. {1}", message.FromUser, e.ToString()), message.Room); }); }
protected override void ProcessMatch(Match match, ChatMessage message, Bot bot) { NGitHub.GitHubClient client = new NGitHub.GitHubClient(); client.Issues.GetIssuesAsync("nuget", match.Groups[2].Value, NGitHub.Models.State.Open, issues => { string issueCount = ""; if (issues.Any()) { issueCount = "@{0}, {1} has {2} issues."; } else { issueCount = "@{0}, {1} has no issues, this has to be wrong. I know that code isn't perfect."; } bot.Say(string.Format(issueCount, message.FromUser, match.Groups[2], issues.Count()), message.Room); }, e => { bot.Say(String.Format("I'm affriad I can't do that {0}. {1}", message.FromUser, e.ToString()), message.Room); }); }