示例#1
0
        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));
        }
示例#2
0
        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());
        }
示例#3
0
 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);
 }
示例#5
0
 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");
 }