public bool handleURL(string url, IrcClient ctx, CtcpClient ctpcclient = null, IIrcMessageSource source = null )
        {
            var title = GetPageTitle(url).Trim();
            if (!string.IsNullOrWhiteSpace(title))
            {
                if(title.ToLower().Contains("Domainpark - Bitte den Rasen nicht betreten".ToLower()))
                {
                    int roll = random.Next(0, 101);
                    if(roll < 5)
                    {
                        if(ctpcclient != null)
                        {
                            string textMessage = "slaps " + source.Name + " and screamed:";
                            BotDeathmicMessageTarget target = new BotDeathmicMessageTarget();
                            target.Name = Properties.Settings.Default.Channel.ToString();
                            ctpcclient.SendAction(target, textMessage);
                            ctx.LocalUser.SendMessage(Properties.Settings.Default.Channel, "Runter vom Rasen!");
                        }
                    }
                }
                else
                {
                    if(title.ToLower() == "Imgur: The most awesome images on the Internet".ToLower())
                    {

                    }
                    else
                    {
                        ctx.LocalUser.SendMessage(Properties.Settings.Default.Channel, title);
                    }

                }
            }
            return true;
        }
Beispiel #2
0
        private void AddStream(IrcClient client, IIrcMessageSource source, IList<IIrcMessageTarget> targets, string command, IList<string> parameters)
        {
            if (parameters.Count > 0)
            {
                _streamProviderManager.AddStream(parameters[0]);
            }
            int message = xmlprovider.AddStream(parameters[0]);
            if (message == 1)
            {
                //Add Streams to user
                foreach(User user in LUserList.Where(x => x.bShouldSubscribe()))
                {
                    user.addStream(parameters[0],true);
                }
                SaveUserList();

                client.LocalUser.SendMessage(Properties.Settings.Default.Channel.ToString(), String.Format("{0} added {1} to the streamlist", source.Name, parameters[0]));
            }
            else if (message == 2)

            {
                BotDeathmicMessageTarget target = new BotDeathmicMessageTarget();
                target.Name = Properties.Settings.Default.Channel.ToString();

                string textMessage = "slaps " + source.Name + " around for being an idiot.";
                ctcpClient1.SendAction(target, textMessage);
            }
            else if(message == 0)
            {
                client.LocalUser.SendNotice(source.Name, "There has been an error please report to a programmer.");
            }
        }
Beispiel #3
0
        private void SendMessage(IrcClient client, IIrcMessageSource source, IList<IIrcMessageTarget> targets, string command, IList<string> parameters)
        {
            if(Rnd.Next(101) < 60)
            {
                client.LocalUser.SendMessage(Properties.Settings.Default.Channel.ToString(), combineParameters(parameters));
            }
            else
            {
                BotDeathmicMessageTarget target = new BotDeathmicMessageTarget();
                target.Name = Properties.Settings.Default.Channel.ToString();

                string textMessage = "slaps " + source.Name + " around for trying to make him say inapropriate stuff.";
                ctcpClient1.SendAction(target, textMessage);
            }
        }