Reply() public method

public Reply ( Object format ) : void
format Object
return void
Exemplo n.º 1
0
 public override void Process(CmdTrigger trigger)
 {
     var nick = trigger.Args.NextWord();
     var messagetosend = trigger.Args.Remainder;
     if (string.IsNullOrEmpty(nick) || string.IsNullOrEmpty(messagetosend))
     {
         trigger.Reply("Failed to parse input, please try again");
     }
     else
     {
         using (var db = new UtilityBotDBContainer())
         {
             var msg = new Message
             {
                 DateLeft = DateTime.Now.ToString(),
                 FromIrcNick = trigger.User.Nick,
                 IrcNick = nick,
                 MessageText = messagetosend
             };
             db.Messages.AddObject(msg);
             db.SaveChanges();
             trigger.Reply("Message saved");
             return;
         }
     }
 }
Exemplo n.º 2
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string nextWord = trigger.Args.NextWord().ToLower();
         if (nextWord == "safe")
         {
             trigger.Reply("Safely shutting down WCell saving data and Starting it up again");
             var prog = new Process
             {
                 StartInfo = { FileName = @"c:\wcellupdater.exe", Arguments = @"c:\wcellsource\run\ c:\run\ debug\" }
             };
             prog.Start();
         }
         if (nextWord == "utility")
         {
             trigger.Reply("Restarting Utility - If there is no auto restarter the utility will not return");
             JadBot.Parser.Kill();
             var restartbat = new StreamWriter("Restartbat.bat") {AutoFlush = true};
             restartbat.WriteLine("taskkill /F /IM jad_bot.exe");
             restartbat.WriteLine("start " + JadBot.Utility.StartInfo.FileName);
             var cmd = new Process {StartInfo = {FileName = "cmd.exe", Arguments = "start RestartBat.bat"}};
             cmd.Start();
         }
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 3
0
        public override void Process(CmdTrigger<IrcCmdArgs> trigger)
        {
            var chan = trigger.Args.Channel;
            var voteChan = trigger.Text.NextWord();
            Vote vote;

            // If we have a channel given in the argument list
            if (voteChan.Length > 0)
                vote = Vote.GetVote(trigger.Args.IrcClient.GetChannel(voteChan));
            vote = Vote.GetVote(chan);

            if (vote != null)
            {

                trigger.Reply("The vote has ended!");
                trigger.Reply(VoteMgr.Mgr.Stats(vote));
                trigger.Reply(VoteMgr.Mgr.Result(vote));
                VoteMgr.Mgr.EndVote(vote);
                return;

            }

            else
            {
                Vote[] votesArray = new Vote[VoteMgr.Votes.Values.Count];
                VoteMgr.Votes.Values.CopyTo(votesArray, 0);
                foreach (var vte in votesArray)
                    VoteMgr.Mgr.EndVote(vte);
                trigger.Reply("Disposed of {0} vote[s].", votesArray.Length);
            }
        }
Exemplo n.º 4
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string filename = trigger.Args.NextWord();
         string httpLink = trigger.Args.Remainder;
         if(string.IsNullOrEmpty(filename) || string.IsNullOrEmpty(httpLink))
         {
             trigger.Reply("Error, invalid arguements try @help downloadlog");
             return;
         }
         trigger.Reply("Attempting to download log from {0} and save in unparsed folder as {1}", httpLink,
                       filename);
         var client = new WebClient();
         client.DownloadFile(httpLink, JadBot.UnparsedFolder + filename);
         using (var downloadedfile = new StreamReader(JadBot.UnparsedFolder + filename))
         {
             if (downloadedfile.BaseStream.Length < 1)
             {
                 trigger.Reply("The downloaded file looks empty, are you sure your link is valid?");
             }
             else
             {
                 trigger.Reply(
                     "Download complete file is saved in the unparsed logs folder as {0} you can now use the parse command on it.",
                     filename);
             }
         }
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 5
0
 public override void Process(CmdTrigger trigger)
 {
     var username = trigger.Args.NextWord();
     var userlevel = trigger.Args.NextWord().ToLower();
     if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(userlevel))
     {
         trigger.Reply("Invalid input please try again!");
     }
     else
     {
         if (!ValidateUserLevel(userlevel))
         {
             trigger.Reply("Invalid userlevel specified, options are guest,user,admin");
             return;
         }
         using (var db = new UtilityBotDBContainer())
         {
             foreach (var account in Queryable.Where(db.Accounts, account => account.Username == username))
             {
                 account.UserLevel = userlevel;
                 trigger.Reply("Account level changed to " + userlevel);
                 db.SaveChanges();
                 return;
             }
         }
     }
 }
Exemplo n.º 6
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         var helpName = trigger.Args.NextWord().ToLower();
         var helpText = trigger.Args.Remainder;
         if(!string.IsNullOrEmpty(helpName) && !string.IsNullOrEmpty(helpText))
         {
             if (string.IsNullOrEmpty(Convert.ToString(HelpCommandsManager.Search(helpName))))
             {
                 HelpCommandsManager.Add(HelpCommand.CreateHelpCommand(helpName, helpText));
                 trigger.Reply(string.Format("Added new command HelpTrigger: {0} HelpText: {1}", helpName, helpText));
             }
             else
             {
                 trigger.Reply("That help trigger already exists, please delete it first!");
             }
         }
         else
         {
             trigger.User.Msg("An error occured adding the specified command, one of the values came out as null, please check and try again or report the error!");
         }
     }
     catch (Exception e)
     {
         UtilityMethods.Print(e.Message + e.Data + e.StackTrace, true);
     }
 }
Exemplo n.º 7
0
 public override void Process(CmdTrigger trigger)
 {
     var user = trigger.User;
     if (user == null)
     {
         trigger.Reply("AuthCommand requires User-argument.");
     }
     else
     {
         if (user.IsAuthenticated)
         {
             trigger.Reply("User {0} is authed as: {1}", user.Nick, user.AuthName);
         }
         else
         {
             var authMgr = trigger.irc.AuthMgr;
             if (authMgr.IsResolving(user))
             {
                 trigger.Reply("User {0} is being resolved - Please wait...", user.Nick, user.AuthName);
             }
             else if (!authMgr.CanResolve)
             {
                 trigger.Reply("Authentication is not supported on this Network.");
             }
             else
             {
                 trigger.Reply("Resolving User...".Colorize(IrcColorCode.Red));
                 authMgr.ResolveAuth(user);
             }
         }
     }
 }
Exemplo n.º 8
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string[] attacks = {
                                "slaps %s",
                                "kicks %s",
                                "punches %s in the face",
                                "stings %s with a needle",
                                "shoots %s with a phaser"
                            };
         if (!string.IsNullOrEmpty(trigger.Args.Remainder))
         {
             var rand = new Random();
             int randomchoice = rand.Next(0, 4);
             if (trigger.Channel != null && !trigger.Channel.HasUser(trigger.Args.Remainder))
             {
                 trigger.Reply("I can't find that person to attack them!");
                 return;
             }
             string attack = attacks[randomchoice].Replace("%s", trigger.Args.Remainder);
             JadBot.Irc.CommandHandler.Describe(trigger.Target, attack, trigger.Args);
         }
         else
         {
             trigger.Reply("You didnt give me a nick to attack!");
         }
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 9
0
            public override void Process(CmdTrigger trigger)
            {
                try
                {
                    int fahrenheit = Convert.ToInt32(trigger.Args.Remainder.Trim());
                    int celsius = (fahrenheit - 32) * 5 / 9;
                    int kelvin = (fahrenheit + 459) * 5 / 9;

                    trigger.Reply(trigger.Args.Remainder + " Fahrenheit is , " + celsius + "C , " + kelvin + " Kelvin");
                }
                catch (Exception e)
                {
                    trigger.Reply(e.ToString());
                }
            }
Exemplo n.º 10
0
            public override void Process(CmdTrigger trigger)
            {
                try
                {
                    int celsius = Convert.ToInt32(trigger.Args.Remainder.Trim());
                    int fahrenheit = (celsius * 9 / 5) + 32;
                    int kelvin = celsius + 273;

                    trigger.Reply(trigger.Args.Remainder + " Celsius is , " + fahrenheit + "F , " + kelvin + " Kelvin");
                }
                catch (Exception e)
                {
                    trigger.Reply(e.ToString());
                }
            }
Exemplo n.º 11
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string target = trigger.Target.ToString();
         if (trigger.Args.NextModifiers() == "target")
         {
             target = trigger.Args.NextWord();
         }
         JadBot.Irc.CommandHandler.Describe(target, trigger.Args.Remainder, trigger.Args);
     }
     catch (Exception e)
     {
         trigger.Reply("I cant write that action, perhaps invalid target?");
         trigger.Reply(e.Message);
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 12
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         trigger.Reply("If you have a picture you like show us or perhaps a file you want to send us .rar it and upload to http://bayimg.com/ and show us the link.");
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 13
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         trigger.Reply("http://wiki.wcell.org/index.php/WCell_API");
     }
     catch (Exception)
     {
         //None
     }
 }
Exemplo n.º 14
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string searchTerm = trigger.Args.Remainder.Replace(" ", "%20");
         trigger.Reply("http://thepiratebay.org/search/" + searchTerm + "/0/7/0");
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 15
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         trigger.Reply(
             "AreaTriggers \n GOs \n Items \n NPCs \n Quests \n SpellsAndEffects \n Vehicles \n use these for the dumptype on the query command!");
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 16
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string target = trigger.Target.ToString();
         if (trigger.Args.NextModifiers() == "target")
         {
             target = trigger.Args.NextWord();
         }
         if(!string.IsNullOrEmpty(trigger.Args.Remainder))
         trigger.Irc.CommandHandler.Describe(target, trigger.Args.Remainder, trigger.Args);
         else
         trigger.Reply("Empty action");
     }
     catch (Exception e)
     {
         trigger.Reply("I cant write that action, perhaps invalid target?");
         trigger.Reply(e.Message);
         UtilityMethods.Print(e.Message + e.Data + e.StackTrace, true);
     }
 }
Exemplo n.º 17
0
            //~find World.ReSync
            public override void Process(CmdTrigger trigger)
            {
                try
                {
                    trigger.Reply("Hai, I don't work yet! :O");

                }
                catch (Exception e)
                {
                    WriteErrorSystem.WriteError(e);
                }
            }
Exemplo n.º 18
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         var lines = trigger.Irc.Client.SendQueue.Length;
         trigger.Irc.Client.SendQueue.Clear();
         trigger.Reply("Cleared SendQueue of {0} lines", lines);
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 19
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         var norris = new StreamWriter("LinusFacts.txt", true) { AutoFlush = false };
         norris.WriteLine(trigger.Args.Remainder);
         trigger.Reply("Added the new Linus Torvalds fact: {0} to storage", trigger.Args.Remainder);
         norris.Close();
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 20
0
        public override void Process(CmdTrigger <IrcCmdArgs> trigger)
        {
            var chan = trigger.Args.Channel;

            if (chan == null)
            {
                chan = trigger.Args.IrcClient.GetChannel(trigger.Text.NextWord());
                if (chan == null)
                {
                    trigger.Reply("Invalid Channel.");
                    return;
                }
            }
            chan.Topic = trigger.Text.Remainder;
        }
Exemplo n.º 21
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         using (var norris = new StreamWriter("ChuckNorrisFacts.txt", true))
         {
             norris.WriteLine(trigger.Args.Remainder);
             trigger.Reply("Added the new Chuck Norris fact: {0} to storage", trigger.Args.Remainder);
         }
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 22
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         var linusLines = new List<string>();
         var linus = new StreamReader("LinusFacts.txt");
         while (!linus.EndOfStream)
         {
             linusLines.Add(linus.ReadLine());
         }
         var rand = new Random();
         int randnum = rand.Next(0, linusLines.Count - 1);
         trigger.Reply(linusLines[randnum]);
         linus.Close();
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 23
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string summary = "", description = "";
         PageAttributes attributes = new PageAttributes();
         bool notify = false;
         while (trigger.Args.HasNext)
         {
             var next = trigger.Args.NextModifiers();
             switch (next)
             {
                 case "s":
                 case "summary":
                     summary = trigger.Args.NextWord("\"");
                     break;
                 case "d":
                 case "description":
                     description = trigger.Args.NextWord("\"");
                     break;
                 case "a":
                 case "attr":
                     attributes.comment = trigger.Args.NextWord("\"");
                     break;
                 case "n":
                 case "notify":
                     notify = Convert.ToBoolean(trigger.Args.NextWord());
                     break;
                 default:
                     Console.WriteLine(trigger.Args.NextWord("\""));
                     break;
             }
         }
         trigger.Reply(TracBackend.CreateTicket(summary, description, attributes, notify));
     }
     catch (Exception e)
     {
         // Error handling
     }
 }
Exemplo n.º 24
0
        public override void Process(CmdTrigger <IrcCmdArgs> trigger)
        {
            var user = trigger.Args.User;

            if (user == null)
            {
                trigger.Reply("AuthCommand requires User-argument.");
            }
            else
            {
                if (user.IsAuthenticated)
                {
                    trigger.Reply("User {0} is authed as: {1}", user.Nick, user.AuthName);
                }
                else
                {
                    var authMgr = trigger.Args.IrcClient.AuthMgr;
                    if (authMgr.IsResolving(user))
                    {
                        trigger.Reply("User {0} is being resolved - Please wait...", user.Nick, user.AuthName);
                    }
                    else if (!authMgr.CanResolve)
                    {
                        trigger.Reply("Authentication is not supported on this Network.");
                    }
                    else
                    {
                        trigger.Reply("Resolving User...".Colorize(IrcColorCode.Red));
                        if (!user.ResolveAuthentication())
                        {
                            trigger.Reply("Failed to resolve user - This network's authentication method is probably not supported.".Colorize(IrcColorCode.Red));
                        }
                    }
                }
            }
        }
Exemplo n.º 25
0
 public override void Process(CmdTrigger trigger)
 {
     //trigger.Reply(IrcClient.Version);
     AssemblyName asmName = Assembly.GetAssembly(GetType()).GetName();
     trigger.Reply(asmName.Name + ", v" + asmName.Version);
 }
Exemplo n.º 26
0
 public override void Process(CmdTrigger trigger)
 {
     var chan = trigger.Channel;
     if (chan == null)
     {
         chan = trigger.irc.GetChannel(trigger.Args.NextWord());
         if (chan == null)
         {
             trigger.Reply("Invalid Channel.");
             return;
         }
     }
     chan.Topic = trigger.Args.Remainder;
 }
Exemplo n.º 27
0
        public override void Process(CmdTrigger trigger)
        {
            var match = trigger.Args.NextWord();
            IList<Command> cmds;
            if (match.Length > 0)
            {
                cmds = new List<Command>();
                foreach (var cmd in IrcCommandHandler.List)
                {
                    if (cmd.Enabled &&
                        trigger.MayTrigger(cmd) &&
                        cmd.Aliases.FirstOrDefault(ali => ali.IndexOf(match, StringComparison.InvariantCultureIgnoreCase) != -1) != null)
                    {
                        cmds.Add(cmd);
                    }
                }
                if (cmds.Count == 0)
                {
                    trigger.Reply("Could not find a command matching '{0}'", match);
                }
                else
                {
                    trigger.Reply("Found {0} matching commands: ", cmds.Count);
                }
            }
            else
            {
                trigger.Reply("Use \"Help <searchterm>\" to receive help on a certain command. - All current commands:");
                cmds = IrcCommandHandler.List.Where(cmd => cmd.Enabled && trigger.MayTrigger(cmd)).ToList();
            }

            var line = "";
            foreach (var cmd in cmds)
            {
                if (cmds.Count <= MaxUncompressedCommands)
                {
                    var desc = string.Format("{0} ({1})", cmd.Usage, cmd.Description);
                    trigger.Reply(desc);
                }
                else
                {
                    var info = cmd.Name;
                    info += " (" + cmd.Aliases.ToString(", ") + ")  ";

                    if (line.Length + info.Length >= IrcProtocol.MaxLineLength)
                    {
                        trigger.Reply(line);
                        line = "";
                    }

                    line += info;
                }
            }

            if (line.Length > 0)
            {
                trigger.Reply(line);
            }
        }
Exemplo n.º 28
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         var helpName = trigger.Args.NextWord().ToLower();
         if (!string.IsNullOrEmpty(helpName))
         {
             var cmd = HelpCommandsManager.Search(helpName);
             if (cmd != null)
             {
                 HelpCommandsManager.Delete(cmd);
                 trigger.Reply(string.Format("Deleted command HelpTrigger: {0} HelpText: {1}", cmd.HelpName, cmd.HelpText));
             }
             else
             {
                 trigger.Reply("No command was found with that name!");
             }
         }
         else
         {
             trigger.Reply("An error occured deleting the specified command, it appears that the command did not exist, please check and try again or report the error!");
         }
     }
     catch (Exception e)
     {
         UtilityMethods.Print(e.Message + e.Data + e.StackTrace, true);
     }
 }
Exemplo n.º 29
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string[] eightballanswers = {
                                         "As I see it, yes",
                                         "Ask again later",
                                         "Better not tell you now",
                                         "Cannot predict now",
                                         "Concentrate and ask again",
                                         "Don't count on it",
                                         "It is certain",
                                         "It is decidedly so",
                                         "Most likely",
                                         "My reply is no",
                                         "My sources say no",
                                         "Outlook good",
                                         "Outlook not so good",
                                         "Reply hazy, try again",
                                         "Signs point to yes",
                                         "Very doubtful",
                                         "Without a doubt",
                                         "Yes",
                                         "Yes - definitely",
                                         "You may rely on it"
                                     };
         if (!String.IsNullOrEmpty(trigger.Args.Remainder))
         {
             var rand = new Random();
             var randomchoice = rand.Next(0, 19);
             trigger.Reply(eightballanswers[randomchoice]);
         }
         else
         {
             trigger.Reply("You didnt give me a decision question!");
         }
     }
     catch (Exception e)
     {
         UtilityMethods.Print(e.Message + e.Data + e.StackTrace, true);
     }
 }
Exemplo n.º 30
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         if (trigger.Args.Remainder.Length > 0)
         {
             using (var readWriter = new StreamWriter(JadBot.GeneralFolder + "Options.txt") { AutoFlush = true })
             {
                 var dumptype = "";
                 string filterterms = "";
                 var pos = trigger.Args.Position;
                 var next = trigger.Args.NextModifiers().ToLower();
                 if (next == "dumptype" || next == "dt" || next == "d")
                 {
                     dumptype = trigger.Args.NextWord().ToLower();
                 }
                 else
                     trigger.Args.Position = pos;
                 next = trigger.Args.NextModifiers().ToLower();
                 if (next == "filter" || next == "f" || next == "ft")
                 {
                     filterterms = trigger.Args.NextWord();
                 }
                 switch (dumptype)
                 {
                     case "areatriggers":
                         {
                             dumptype = "areatriggers.txt";
                         }
                         break;
                     case "gos":
                         {
                             dumptype = "gos.txt";
                         }
                         break;
                     case "items":
                         {
                             dumptype = "items.txt";
                         }
                         break;
                     case "npcs":
                         {
                             dumptype = "npcs.txt";
                         }
                         break;
                     case "quests":
                         {
                             dumptype = "quests.txt";
                         }
                         break;
                     default:
                         {
                             dumptype = "spellsandeffects.txt";
                         }
                         break;
                     case "vehicles":
                         {
                             dumptype = "vehicles.txt";
                         }
                         break;
                 }
                 List<string> readOutput = JadBot.DumpReader.Read(dumptype, trigger.Args.Remainder,filterterms);
                 if (readOutput.Capacity < 1 || string.IsNullOrEmpty(readOutput[0]))
                 {
                     trigger.Reply("No Results!");
                     return;
                 }
                 int id = -1;
                 foreach (var line in readOutput)
                 {
                     id++;
                     if(id < 5)
                         trigger.Reply(id + ": " + line);
                     readWriter.WriteLine(id + ": " + line);
                 }
             }
             trigger.Reply(JadBot.WebLinkToGeneralFolder + "Options.txt");
         }
         else
         {
             trigger.Reply("It looks to me like you didnt put a query! :O");
         }
     }
     catch (Exception e)
     {
         WriteErrorSystem.WriteError(e);
     }
 }
Exemplo n.º 31
0
 /// <summary>
 /// Fires when the aliasing engine cannot find a command.
 /// Sends the command to the Server when not overridden.
 /// </summary>
 protected virtual void OnUnknownCommandUsed(CmdTrigger trigger)
 {
     trigger.Reply("Use " + CommandHandler.RemoteCommandPrefix + "Help for an overview over all available commands!");
     //Send(trigger.Args.String);
 }
Exemplo n.º 32
0
        public override void Process(CmdTrigger <IrcCmdArgs> trigger)
        {
            var cmdHandler = trigger.Args.IrcClient.CommandHandler;
            List <BaseCommand <IrcCmdArgs> > cmds;

            if (trigger.Text.HasNext)
            {
                // help for a specific command
                var cmdStr = trigger.Text.Remainder;
                cmds = cmdHandler.GetCommands(cmdStr);
                var count = cmds.Count;
                foreach (var cmd in cmds)
                {
                    if (cmdHandler.MayDisplay(trigger, cmd, false))
                    {
                        cmdHandler.DisplayCmd(trigger, cmd, false, true);
                    }
                    else
                    {
                        count--;
                    }
                }

                if (count == 0)
                {
                    trigger.ReplyFormat("Did not find any Command that matches '{0}'.", cmdStr);
                }
            }
            else
            {
                // help for all commands
                cmds = new List <BaseCommand <IrcCmdArgs> >();
                foreach (var cmd in cmdHandler.Commands)
                {
                    if (cmdHandler.MayDisplay(trigger, cmd, false))
                    {
                        cmds.Add(cmd);
                    }
                }

                trigger.Reply("Use: ? <Alias> [<subalias> [<subalias> ...]] for help on a certain command. - All current commands:");
            }

            string line = "";

            foreach (var cmd in cmds)
            {
                if (cmds.Count <= MaxUncompressedCommands)
                {
                    trigger.Reply(cmd.CreateUsage(trigger));
                }
                else
                {
                    var info = cmd.Name + " (" + cmd.Aliases.ToString(", ") + ")  ";

                    if (line.Length + info.Length >= IrcProtocol.MaxLineLength)
                    {
                        trigger.Reply(line);
                        line = "";
                    }

                    line += info;
                }
            }

            if (line.Length > 0)
            {
                trigger.Reply(line);
            }
        }
Exemplo n.º 33
0
 public override void Process(CmdTrigger trigger)
 {
     try
     {
         string randfilename = UtilityMethods.GetLink();
         using (var selectionWriter = new StreamWriter(JadBot.GeneralFolder + string.Format("Selection{0}.txt", randfilename)))
         {
             List<string> selectOutput = JadBot.DumpReader.Select(trigger.Args.NextInt());
             if (selectOutput.Count > 0)
             {
                 foreach (var line in selectOutput)
                 {
                     selectionWriter.WriteLine(line);
                 }
             }
             else
             {
                 trigger.Reply("The output from the selector was null :O");
             }
         }
         trigger.Reply(JadBot.WebLinkToGeneralFolder + string.Format("Selection{0}.txt", randfilename));
     }
     catch (Exception excep)
     {
         trigger.Reply("The Following Exception Occured {0}, check input", excep.Message);
         WriteErrorSystem.WriteError(excep);
     }
 }