Exemple #1
0
        /// <summary>
        /// Interprets commands
        /// </summary>
        /// <param name="command">The full message</param>
        /// <param name="sender">The full sender</param>
        /// <param name="recipient">The full recipient</param>
        private static void InterpretCommand(string command, IrcUser sender, IrcClient client)
        {
            command = command.TrimStart(ProgramSettings.settings.CommandPrefix); //simply removes the prefix

            if (command.StartsWith ("slap"))
            {
                if (ProgramSettings.settings.SlapEnabled)
                {
                    string[] splitCommand = command.Split (new char[] { ' ' }, 2);
                    if (splitCommand.Length > 1)
                    {
                        var listCopy = UsersList;
                        bool foundUser = false;
                        try
                        {
                            foreach (IrcUserAndSeen user in listCopy)
                            {
                                if (user.User.Nick.ToLower () == splitCommand [1].ToLower ().Trim ())
                                {
                                    if (user.User.Nick == client.User.Nick)
                                        client.SendRawMessage ("PRIVMSG {0} :What'd I do? :(", client.Channels [0].Name);
                                    else
                                        client.SendRawMessage ("PRIVMSG {0} :" + "\x01" + "ACTION slaps {1} with a giant fish.\x01", client.Channels [0].Name, user.User.Nick);
                                    foundUser = true;
                                    break;
                                }
                            }
                            if (!foundUser)
                                client.SendRawMessage ("PRIVMSG {0} :User not found!");
                        }
                        catch{}
                    } else
                        client.SendRawMessage ("PRIVMSG {0} :Slap who?", client.Channels [0].Name);
                }
            }
            if (command.StartsWith("removeuser"))
            {
                string[] split = command.Split(new char[]{' '}, 2);
                Console.ForegroundColor = ConsoleColor.Yellow;
                if (split.Length > 1)
                {
                    bool removed = false;
                    for(int i = 0; i < ProgramSettings.settings.UsersAllowedToDisable.Count; i++)
                    {
                        if (ProgramSettings.settings.UsersAllowedToDisable[i] == split[1].ToLower())
                        {
                            ProgramSettings.settings.UsersAllowedToDisable.RemoveAt(i);
                            removed = true;
                        }
                    }
                    if (removed)
                    {
                        Console.WriteLine("Removed user \"{0}\" successfully!", split[1].ToLower());
                        client.SendRawMessage("PRIVMSG {0} :Removed user \"{1}\" successfully!", client.Channels[0].Name, split[1].ToLower());
                    }
                    else
                    {
                        Console.WriteLine("User doesn't exist!");
                        client.SendRawMessage("PRIVMSG {0} :That user never existed in the database!", client.Channels[0].Name);
                    }
                }
                else
                {
                    Console.WriteLine("Remove who?");
                }
                Console.ForegroundColor = ConsoleColor.White;
            }
            if (command.StartsWith("adduser"))
            {
                string[] split = command.Split(new char[]{' '}, 2);
                Console.ForegroundColor = ConsoleColor.Yellow;
                if (split.Length > 1)
                {
                    ProgramSettings.settings.UsersAllowedToDisable.Add(split[1].ToLower());
                    Console.WriteLine("Added user \"{0}\" to the VIP list", split[1].ToLower());
                    client.SendRawMessage("PRIVMSG {0} :Added user \"{1}\" to the VIP list.?", client.Channels[0].Name, split[1].ToLower());
                }
                else
                {
                    Console.WriteLine("Who?");
                    client.SendRawMessage("PRIVMSG {0} :Add who?", client.Channels[0].Name);
                }
                Console.ForegroundColor = ConsoleColor.White;
            }
            if (command.StartsWith("disableseen"))
            {
                foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (user.ToLower() == sender.Nick.ToLower())
                    {
                        ProgramSettings.settings.SeenEnabled = false;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Seen Command Disabled");
                        Console.ForegroundColor = ConsoleColor.White;
                        client.SendRawMessage ("PRIVMSG {0} :Disabled seen command!", client.Channels[0].Name);
                    }
                }
            }
            if (command.StartsWith("enableseen"))
            {
                foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (user.ToLower() == sender.Nick.ToLower())
                    {
                        ProgramSettings.settings.SeenEnabled = true;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Seen Command Enabled");
                        Console.ForegroundColor = ConsoleColor.White;
                        client.SendRawMessage ("PRIVMSG {0} :Enabled seen command!", client.Channels[0].Name);
                    }
                }
            }
            if (command.StartsWith ("enableurlparse"))
            {
                foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (user.ToLower () == sender.Nick.ToLower ())
                    {
                        ProgramSettings.settings.UrlParsingEnabled = true;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("URL Parsing Enabled");
                        Console.ForegroundColor = ConsoleColor.White;
                        client.SendRawMessage ("PRIVMSG {0} :Enabling URL parsing!", client.Channels[0].Name);
                    }
                }
            }
            if (command.StartsWith ("disableurlparse"))
            {
                foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (user.ToLower () == sender.Nick.ToLower ())
                    {
                        ProgramSettings.settings.UrlParsingEnabled = false;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("URL Parsing Disabled");
                        Console.ForegroundColor = ConsoleColor.White;
                        client.SendRawMessage ("PRIVMSG {0} :Disabling URL parsing!", client.Channels[0].Name);
                    }
                }
            }
            if (command.StartsWith ("nick") || command.StartsWith ("name"))
            {
                string[] splitCommand = command.Split (new char[]{ ' ' }, 2);
                if (splitCommand.Length > 1)
                {
                    foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                    {
                        if (user.ToLower () == sender.Nick.ToLower ())
                        {
                            string cleanNick = CleanInput (splitCommand [1]);
                            client.Nick (cleanNick);
                            ProgramSettings.settings.LastUsedNick = client.User.Nick;
                        }
                    }
                }
            }
            if(command.StartsWith("motto") || command.StartsWith("slogan"))
            {
                client.SendRawMessage("PRIVMSG {0} :Luigibot does what Reta don't \u00a9", client.Channels[0].Name);
            }
            if(command.StartsWith("version"))
            {
                #if __MONOCS__
                client.SendRawMessage("PRIVMSG {0} :Luigibot v{1} - http://www.github.com/Luigifan/Luigibot - Running under Mono", client.Channels[0].Name, ProgramVersion.ToString());
                #else
                client.SendRawMessage("PRIVMSG {0} :Luigibot v{1} - http://www.github.com/Luigifan/Luigibot", client.Channels[0].Name, ProgramVersion.ToString());
                #endif
            }
            if(command.StartsWith("changeprefix"))
            {
                string[] splitCommand = command.Split(new char[] { ' ' }, 2);
                if (splitCommand.Length > 1)
                {
                    foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                    {
                        if(user.ToLower() == sender.Nick.ToLower())
                        {
                            if (splitCommand[1].Length == 1)
                            {
                                if (splitCommand[1] == "/")
                                {
                                    client.SendRawMessage("PRIVMSG {0} :oi u cheeky c**t ill bash ur ead in i swear on me mum", client.Channels[0].Name);
                                    return;
                                }
                                try
                                {
                                    char newPrefix = char.Parse(splitCommand[1]);
                                    ProgramSettings.settings.CommandPrefix = newPrefix;

                                    Console.ForegroundColor = ConsoleColor.Yellow;
                                    Console.WriteLine("Command prefix changed to '{0}' successfully!", newPrefix.ToString());
                                    Console.ForegroundColor = ConsoleColor.White;

                                    client.SendRawMessage("PRIVMSG {0} :Command prefix changed to '{1}' successfully!", client.Channels[0].Name, newPrefix.ToString());
                                    return;
                                }
                                catch (Exception ex)
                                {
                                    client.SendRawMessage("PRIVMSG {0} :Uh-oh! Luigibot encountered an error. Email Luigifan @ [email protected]",
                                        client.Channels[0].Name);

                                    Console.ForegroundColor = ConsoleColor.Red;
                                    Console.WriteLine("UH OH BIG ERROR\nUH OH BIG ERROR");
                                    Console.ForegroundColor = ConsoleColor.White;
                                    Console.WriteLine(ex.Message + "\n");
                                }
                            }
                            else
                            {
                                client.SendRawMessage("PRIVMSG {0} :The prefix must be a single character!", client.Channels[0].Name);
                            }
                        }
                    }
                }
                else
                    client.SendRawMessage("PRIVMSG {0} :What character will prefix my commands?", client.Channels[0].Name);
            }
            if(command.StartsWith("kick"))
            {
                //0: command
                //1: user
                //2: reason
                string[] splitCommand = command.Split(new char[] { ' ' }, 3);
                foreach (string user in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if(user.ToLower() == sender.Nick.ToLower())
                    {
                        try
                        {
                            if (splitCommand.Length > 2)
                            {
                                client.KickUser(client.Channels[0].Name, splitCommand[1], splitCommand[2]);
                            }
                            else
                                client.KickUser(client.Channels[0].Name, splitCommand[1]);
                        }
                        catch (Exception ex)
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("ERROR: {0}", ex.Message);
                            Console.ForegroundColor = ConsoleColor.White;
                        }
                    }
                }
            }
            if(command.StartsWith("getmodes"))
            {
                client.SendMessage("Modes: " + client.User.Mode, client.Channels[0].Name);
            }
            if (command.StartsWith ("ann"))
            {
                string[] splitCommand = command.Split (new char[]{ ' ' }, 2);
                if (splitCommand.Length > 1)
                {
                    foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                    {
                        if (sender.Nick.ToLower () == nick)
                        {
                            if (splitCommand [1] == "test")
                            {
                                if (ProgramSettings.settings.WelcomeMessage.Contains ("/me"))
                                {
                                    client.SendAction (String.Format (ProgramSettings.settings.WelcomeMessage.Substring (4), sender.Nick), client.Channels [0].Name);
                                } else
                                {
                                    client.SendRawMessage ("PRIVMSG {0} :{1}",
                                        client.Channels [0].Name,
                                        String.Format (ProgramSettings.settings.WelcomeMessage, sender.Nick));
                                }
                            }
                            else
                            {
                                if(splitCommand[1].Contains("{") && splitCommand[1].Contains("}"))
                                {
                                    string[] tester = splitCommand[1].Split(new char[] { '{', '}' }, 3);
                                    foreach(string x in tester)
                                    {
                                        int xf = -1;
                                        bool parsed = false;
                                        try
                                        {
                                            xf = int.Parse(x.ToString());
                                            parsed = true;
                                        }
                                        catch{parsed = false;}

                                        if (parsed)
                                        {
                                            if (xf > 0 || xf < 0)
                                            {
                                                client.SendRawMessage("PRIVMSG {0} :ERROR: Index numbers can't be bigger than 0 or less than 0. MUST BE 0!", client.Channels[0].Name);
                                                return;
                                            }
                                        }
                                    }
                                }
                                ProgramSettings.settings.WelcomeMessage = splitCommand [1];
                                client.SendRawMessage ("PRIVMSG {0} :Welcome message set!", client.Channels [0].Name);
                                Console.ForegroundColor = ConsoleColor.Yellow;
                                Console.WriteLine ("New welcome message set: " + splitCommand [1]);
                                Console.ForegroundColor = ConsoleColor.White;
                            }
                        }
                    }
                }
                else
                {
                    client.SendRawMessage ("PRIVMSG {0} :What message do I set?", client.Channels[0].Name);
                }
            }
            if (command.StartsWith ("enableslap"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ProgramSettings.settings.SlapEnabled = true;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Enabling slap");
                        Console.ForegroundColor = ConsoleColor.White;

                        break;
                    }
                }
            }
            if (command.StartsWith ("enablewelcome"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ProgramSettings.settings.WelcomeUserEnabled = true;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Enabling welcome messages");
                        Console.ForegroundColor = ConsoleColor.White;

                        break;
                    }
                }
            }
            if (command.StartsWith ("disablewelcome"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ProgramSettings.settings.WelcomeUserEnabled = false;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Disabling welcome messages");
                        Console.ForegroundColor = ConsoleColor.White;

                        break;
                    }
                }
            }
            if (command.StartsWith ("disableslap"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ProgramSettings.settings.SlapEnabled = false;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Disabling slap");
                        Console.ForegroundColor = ConsoleColor.White;

                        break;
                    }
                }
            }
            if (command.StartsWith ("eightball") || command.StartsWith ("8ball") || command.StartsWith ("fortune"))
            {
                if (ProgramSettings.settings.EightballEnabled)
                {
                    int ranMessage = random.Next (EightballMessages.Length - 1);
                    if (command.ToLower ().Contains ("waluigibot1337") || command.ToLower ().Contains ("waluigibot") || command.ToLower ().Contains ("waluigi bot"))
                        client.SendRawMessage ("PRIVMSG {0} :Waluigibot is a tool and will never come to fruition.", client.Channels [0].Name);
                    else if (command.ToLower ().Contains ("bot") && !command.ToLower ().Contains ("luigi"))
                        client.SendRawMessage ("PRIVMSG {0} :Your bot is inadequate for the job.", client.Channels [0].Name);
                    else
                        client.SendRawMessage ("PRIVMSG {0} :{1}", client.Channels [0].Name, EightballMessages [ranMessage]);
                }
            }
            if (command.StartsWith ("status"))
            {
                client.SendRawMessage ("PRIVMSG {0} :Slap Enabled: {1}. Eight Ball Enabled: {2}. Welcome Enabled: {3}. Command Prefix: {4}. URL Parsing: {5}",
                    client.Channels [0].Name,
                    ProgramSettings.settings.SlapEnabled,
                    ProgramSettings.settings.EightballEnabled,
                    ProgramSettings.settings.WelcomeUserEnabled,
                    ProgramSettings.settings.CommandPrefix.ToString(),
                    ProgramSettings.settings.UrlParsingEnabled);
            }
            if (command.StartsWith ("lastfm"))
            {
                #if __MONOCS__
                client.SendRawMessage("PRIVMSG {0} :The Last.FM API we use isn't available on Mono.", client.Channels[0].Name);
                #elif __MSCS__
                string[] split = command.Split (new char[] { ' ' }, 2);
                if (split.Length > 1)
                {
                    client.SendRawMessage("PRIVMSG {0} :Sending LastFM request, this may take a few seconds..", client.Channels[0].Name);
                    try
                    {
                        var lastfmClient = new LastfmClient ("4de0532fe30150ee7a553e160fbbe0e0", "0686c5e41f20d2dc80b64958f2df0f0c");
                        var response = lastfmClient.User.GetRecentScrobbles (split [1].ToString ().Trim (), null, 0, 1);
                        LastTrack lastTrack = response.Result.Content [0];
                        client.SendRawMessage ("PRIVMSG {0} :{1} last listened to {2} by {3}.", client.Channels [0].Name, split [1].Trim (), lastTrack.Name, lastTrack.ArtistName);
                    }
                    catch (ArgumentOutOfRangeException iex)
                    {
                        client.SendRawMessage ("PRIVMSG {0} :That user doesn't exist or hasn't scrobbled anything yet!",
                            client.Channels [0].Name);
                    }
                    catch (Exception ex)
                    {
                        client.SendRawMessage ("PRIVMSG {0} :Uh-oh! Luigibot encountered an error. Email Luigifan @ [email protected]",
                            client.Channels [0].Name);

                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine ("UH OH BIG ERROR\nUH OH BIG ERROR");
                        Console.ForegroundColor = ConsoleColor.White;
                        Console.WriteLine (ex.Message + "\n");
                    }
                }
                #endif
            }
            if (command.StartsWith ("enable8ball") || command.StartsWith ("enableeightball"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ProgramSettings.settings.EightballEnabled = true;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Enabling eight ball");
                        Console.ForegroundColor = ConsoleColor.White;

                        break;
                    }
                }
            }
            if (command.StartsWith ("disable8ball") || command.StartsWith ("disableeightball"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ProgramSettings.settings.EightballEnabled = false;

                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine ("Disabling eight ball");
                        Console.ForegroundColor = ConsoleColor.White;

                        break;
                    }
                }
            }
            if (command.StartsWith ("selfdestruct"))
            {
                foreach (var nick in ProgramSettings.settings.UsersAllowedToDisable)
                {
                    if (sender.Nick.ToLower () == nick)
                    {
                        ExitSafely ();
                        break;
                    }
                }
            }
            if (command.StartsWith ("42"))
            {
                client.SendRawMessage ("PRIVMSG {0} :The Answer to Life, the Universe, and Everything.", client.Channels [0].Name);
            }
            if (command.StartsWith ("commands"))
            {
                client.SendRawMessage ("PRIVMSG {0} :You can find a list of my commands here: https://github.com/Luigifan/Luigibot/wiki/Luigibot-Commands", client.Channels [0].Name);
            }
            if (command.StartsWith ("seen"))
            {
                string[] splitCommand = command.Split (new char[] { ' ' }, 2);
                if (splitCommand.Length > 1)
                {
                    if (splitCommand [1].ToLower () == "knux" || splitCommand [1].ToLower () == "knuckles" || splitCommand [1].ToLower () == "knuckles96")
                    {
                        client.SendRawMessage ("PRIVMSG {0} :Never.", client.Channels [0].Name);
                        return;
                    }
                    var UsersListCopy = UsersList;
                    var UserDatabaseCopy = UsersSeenDatabase.UsersSeenDatabase;
                    //First, check to see if the user is on now
                    bool foundInOnline = false;
                    foreach (IrcUserAndSeen user in UsersListCopy)
                    {
                        if (user.User.Nick.ToLower () == splitCommand [1].ToLower ().Trim ())
                        {
                            foundInOnline = true;
                            if (user.User.Nick == client.User.Nick)
                                client.SendRawMessage ("PRIVMSG {0} :I'm always online c:", client.Channels [0].Name);
                            else
                                client.SendRawMessage ("PRIVMSG {0} :That user is online now!", client.Channels [0].Name);
                            foundInOnline = true;
                            break;
                        }
                    }
                    //Then, we'll check the database
                    bool foundInDatabase = false;
                    List<IrcUserAndSeen> removeLater = new List<IrcUserAndSeen>();
                    if (!foundInOnline)
                    {
                        foreach (IrcUserAndSeen user in UserDatabaseCopy)
                        {
                            if (user.User.Nick == null)
                            {
                                Console.WriteLine("Adding null entry to be removed later");
                                removeLater.Add(user);
                            }
                            else
                            {
                                if (user.User.Nick.ToLower() == splitCommand[1].ToLower().Trim())
                                {
                                    foundInDatabase = true;
                                    client.SendRawMessage("PRIVMSG {0} :{1} was last seen at {2} (EST)", client.Channels[0].Name, user.User.Nick, user.LastSeen.ToString());
                                    break;
                                }
                            }
                        }
                        if (!foundInDatabase && !foundInOnline)
                            client.SendRawMessage ("PRIVMSG {0} :I'm not sure :(", client.Channels [0].Name);
                    }
                } else
                    client.SendRawMessage ("PRIVMSG {0} :Last seen who?", client.Channels [0].Name);
            }
        }
Exemple #2
0
        private static void RunBot(string nick, string server, string channel)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Write("\nConnecting to " + ProgramSettings.settings.LastJoinedServer + " on port 6667....");
            Console.ForegroundColor = ConsoleColor.White;

            client = new IrcClient(ProgramSettings.settings.LastJoinedServer, new IrcUser(ProgramSettings.settings.LastUsedNick, "RetaSharp", "V54swg3!", "RetaReta"));
            client.NetworkError += (s, e) => Console.WriteLine("Error: " + e.SocketError);
            client.ConnectionComplete += (s, e) =>
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Write("\nConnected! Joining " + ProgramSettings.settings.LastJoinedChannel + "...");
                Console.ForegroundColor = ConsoleColor.White;
                client.JoinChannel(ProgramSettings.settings.LastJoinedChannel);
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Write("\nSuccessfully joined " + ProgramSettings.settings.LastJoinedChannel + "\n");
                Console.ForegroundColor = ConsoleColor.White;

            };
            client.ConnectAsync();
            InputThread.Start();

            client.NoticeRecieved += (s, e) =>
            {
                Console.WriteLine("\nNOTICE FROM {0}: {1}", e.Source, e.Notice.ToString());
            };

            client.ChannelMessageRecieved += (s, e) =>
            {

                var channels = client.Channels[e.PrivateMessage.Source];
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.WriteLine("{0} - {1}: {2}", e.PrivateMessage.Source, e.PrivateMessage.User, e.PrivateMessage.Message); //just output the stuff boss
                Console.ForegroundColor = ConsoleColor.White;

                if (e.PrivateMessage.Message.StartsWith(ProgramSettings.settings.Prefix.ToString()))
                {
                    ircCommands(e.PrivateMessage.Message, e.PrivateMessage.User, client);
                }
                else if (e.PrivateMessage.Message.Contains(client.User.Nick))
                {
                    if (e.PrivateMessage.Message.Contains("help"))
                    {
                        char commandpre = ProgramSettings.settings.Prefix;
                        client.SendRawMessage("PRIVMSG {0} :Hi! I'm a bot! The current prefix is {1}. You can get a list of my commands with {1}commands!", client.Channels[0].Name, commandpre);
                    }
                    if (e.PrivateMessage.Message.Contains("Hello".ToLower()) || e.PrivateMessage.Message.Contains("Hi".ToLower()) || e.PrivateMessage.Message.Contains("Hey".ToLower()) || e.PrivateMessage.Message.Contains("Howdy".ToLower()) || e.PrivateMessage.Message.Contains("Hola".ToLower()) || e.PrivateMessage.Message.Contains("Bonjour".ToLower()))
                    {

                        client.SendRawMessage("PRIVMSG {0} :Hello there!", client.Channels[0].Name);
                    }
                    if (e.PrivateMessage.Message.Contains("time"))
                    {
                        string time = DateTime.Now.ToString("h:mm:ss tt");
                        client.SendRawMessage("PRIVMSG {0} :The time is currently {1} UTC-8 (PST).", client.Channels[0].Name, time);
                    }
                    if (e.PrivateMessage.Message.Contains("how") && e.PrivateMessage.Message.Contains("are") || e.PrivateMessage.Message.Contains("you"))
                    {
                        int feels = random.Next(0,6);
                        string imfeeling = feeling[feels];
                        client.SendRawMessage("PRIVMSG {0} :{1}.", client.Channels[0].Name, imfeeling);
                    }

                    if (e.PrivateMessage.Message.Contains("hug") || e.PrivateMessage.Message.Contains("hugs"))
                    {
                        client.SendRawMessage("PRIVMSG {0} :" + "\x01" + "ACTION hugs {1} back.\x01", client.Channels[0].Name, e.PrivateMessage.User.Nick);
                    }

                    if (e.PrivateMessage.Message.Contains("kiss") || e.PrivateMessage.Message.Contains("kisses") || e.PrivateMessage.Message.Contains("makes out"))
                    {
                        client.SendRawMessage("PRIVMSG {0} :" + "\x01" + "ACTION pushes {1} away.\x01", client.Channels[0].Name, e.PrivateMessage.User.Nick);
                        client.SendRawMessage("PRIVMSG {0} :Uhm...no kissing me, {1}.", client.Channels[0].Name, e.PrivateMessage.User.Nick);
                    }
                    if (e.PrivateMessage.Message.Contains("sex") || e.PrivateMessage.Message.Contains("f**k") || e.PrivateMessage.Message.Contains("f***s") || e.PrivateMessage.Message.Contains("humps") || e.PrivateMessage.Message.Contains("rapes") || e.PrivateMessage.Message.Contains("inappropriate") && e.PrivateMessage.Message.Contains("place") || e.PrivateMessage.Message.Contains("places"))
                    {
                        client.SendRawMessage("PRIVMSG {0} :" + "\x01" + "ACTION punches {1}.\x01", client.Channels[0].Name, e.PrivateMessage.User.Nick);
                        client.SendRawMessage("PRIVMSG {0} :DON'T TOUCH ME, {1}!", client.Channels[0].Name, e.PrivateMessage.User.Nick.ToUpper());
                        try
                        {
                            client.SendRawMessage("PRIVMSG CHANSERV :op");
                            try
                            {
                                client.KickUser(client.Channels[0].Name, e.PrivateMessage.User.Nick, "EXPLOIT!");
                            }
                            catch
                            {
                                client.SendRawMessage("PRIVMSG {0} :IF ONLY I COULD KICK YOU...!", client.Channels[0].Name);
                            }
                            client.SendRawMessage("PRIVMSG CHANSERV :deop");
                        }
                        catch
                        {
                            client.SendRawMessage("PRIVMSG {0} :I NEED AN ADMIN!", client.Channels[0].Name);
                        }
                    }

                    if (e.PrivateMessage.Message.Contains("joke"))
                    {
                        Jokes.Joke();
                        client.SendRawMessage("PRIVMSG {0} :{1}", client.Channels[0].Name, Jokes.thisjoke);
                        Console.WriteLine("The joke was " + Jokes.randJoke);
                    }

                }
                else
                {

                    if (e.PrivateMessage.Message.Contains("http://") || e.PrivateMessage.Message.Contains("https://") || e.PrivateMessage.Message.Contains("www.") || e.PrivateMessage.Message.Contains(".com") || e.PrivateMessage.Message.Contains(".net") || e.PrivateMessage.Message.Contains(".org") || e.PrivateMessage.Message.Contains(".ca") || e.PrivateMessage.Message.Contains(".us") || e.PrivateMessage.Message.Contains(".io") || e.PrivateMessage.Message.Contains(".mx") && !e.PrivateMessage.Message.Contains("dnp"))
                    {

                            try
                            {
                                string privatemessage = e.PrivateMessage.Message;
                                WebClient x = new WebClient();
                                client.SendRawMessage("NOTICE {0} :{0} Hold on, grabbing link title...", e.PrivateMessage.User.Nick);
                                string url = e.PrivateMessage.Message.Substring(e.PrivateMessage.Message.LastIndexOf("http://"));
                                string[] cleaned = url.Split(new char[] { ' ' }, 2);
                                if (e.PrivateMessage.Message.Contains(".xxx") || e.PrivateMessage.Message.Contains("p**n"))
                                {
                                    client.SendRawMessage("PRIVMSG {0} :Thanks for posting p**n here, {1}", client.Channels[0].Name, e.PrivateMessage.User.Nick);
                                    return;
                                }
                                string source = x.DownloadString(cleaned[0]);
                                string title = Regex.Match(source, @"\<title\b[^>]*\>\s*(?<Title>[\s\S]*?)\</title\>", RegexOptions.IgnoreCase).Groups["Title"].Value;
                                client.SendRawMessage("PRIVMSG {0} :{3} submitted a link : [ {1} ] - {2}.", client.Channels[0].Name, title, cleaned[0], e.PrivateMessage.User.Nick);
                            }
                            catch
                            {
                                //Do nothing.
                            }
                    }

                    }

            };

            while (true)
                ; //just keeps everything going
        }