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 "air":
if (spam_check == true)
{
ircbot.add_spam_count(channel);
}
if (nick_access >= tmp_command.Access)
{
get_airtime(channel, ircbot);
}
else
{
ircbot.sendData("NOTICE", nick + " :You do not have permission to use that command.");
}
break;
}
}
}
}
}
}