private IEnumerable<ResponseMessage> ListPingHandler(IncomingMessage message, string matchedHandle) { string[] users = _pingPlugin.ListPingedUsers(); yield return message.ReplyDirectlyToUser("I am currently pinging:"); yield return message.ReplyDirectlyToUser(">>>" + string.Join("\n", users)); }
private IEnumerable<ResponseMessage> HelpHandler(IncomingMessage message, string matchedHandle) { var builder = new StringBuilder(); builder.Append(">>>"); var supportedCommands = GetSupportedCommands().OrderBy(x => x.Command); foreach (CommandDescription commandDescription in supportedCommands) { builder.AppendFormat("{0}\t- {1}\n", commandDescription.Command, commandDescription.Description); } yield return message.ReplyDirectlyToUser(builder.ToString()); }
private IEnumerable<ResponseMessage> TestHandler(IncomingMessage message, string matchedHandle) { yield return message.ReplyToChannel($"Hey @{message.Username}, how you doing?"); Thread.Sleep(TimeSpan.FromSeconds(5)); yield return message.ReplyDirectlyToUser("I know where you live..."); }
private IEnumerable<ResponseMessage> AutoResponseHandler(IncomingMessage message, string matchedHandle) { yield return message.ReplyDirectlyToUser(message.FullText); }
private IEnumerable<ResponseMessage> AboutHandler(IncomingMessage message, string matchedHandle) { yield return message.ReplyDirectlyToUser("Noobot - Created by Simon Colmer " + DateTime.Now.Year); yield return message.ReplyDirectlyToUser("I am an extensible SlackBot built in C# using loads of awesome open source projects."); yield return message.ReplyDirectlyToUser("Please find more at http://github.com/noobot/noobot"); }