Bot.Modules.roll_call.control C# (CSharp) Method

control() public method

public control ( bot ircbot, BotConfig Conf, string line, string command, int nick_access, string nick, string channel, bool bot_command, string type ) : void
ircbot bot
Conf BotConfig
line string
command string
nick_access int
nick string
channel string
bot_command bool
type string
return void
        public override void control(bot ircbot, BotConfig Conf, string[] line, string command, int nick_access, string nick, string channel, bool bot_command, string type)
        {
            if (type.Equals("channel") && bot_command == true)
            {
                foreach (Command tmp_command in this.Commands)
                {
                    bool blocked = tmp_command.Blacklist.Contains(channel) || tmp_command.Blacklist.Contains(nick);
                    bool cmd_found = false;
                    bool spam_check = ircbot.get_spam_check(channel, nick, tmp_command.Spam_Check);
                    if (spam_check == true)
                    {
                        blocked = blocked || ircbot.get_spam_status(channel);
                    }
                    cmd_found = tmp_command.Triggers.Contains(command);
                    if (blocked == true && cmd_found == true)
                    {
                        ircbot.sendData("NOTICE", nick + " :I am currently too busy to process that.");
                    }
                    if (blocked == false && cmd_found == true)
                    {
                        foreach (string trigger in tmp_command.Triggers)
                        {
                            switch (trigger)
                            {
                                case "rollcall":
                                    if (spam_check == true)
                                    {
                                        ircbot.add_spam_count(channel);
                                    }
                                    if (nick_access >= tmp_command.Access)
                                    {
                                        if (line.GetUpperBound(0) > 3)
                                        {
                                            if (line[4].StartsWith("#"))
                                            {
                                                channel = line[4];
                                            }
                                            else
                                            {
                                                ircbot.sendData("PRIVMSG", nick + " :Please specify a valid channel");
                                            }
                                        }
                                        string nicks = "";
                                        Channel_Info chan_info = ircbot.get_chan_info(channel);
                                        foreach (Nick_Info info in chan_info.Nicks)
                                        {
                                            nicks += info.Nick + ", ";
                                        }
                                        ircbot.sendData("PRIVMSG", channel + " :" + this.Options["roll_call_message"] + ": " + nicks.Trim().TrimEnd(','));
                                    }
                                    break;
                            }
                        }
                    }
                }
            }
        }
roll_call