I'm having trouble getting started my node.js IRC bot

So, as a project I am adapting this bot for my IRC channel: https://gist.github.com/996827

What I am trying to do is test out it's ability to send out messages. The message function seems to work fine, but I'm having a bit of a hard time trying to make it "listen" for messages from the channel.

//handles incoming messages
irc.handle = function(data)
{
  var i, info;
  for (i = 0; i < irc.listeners.length; i++)
  {
    info = irc.listeners[i][0].exec(data);
    if (info)
    {
      irc.listeners[i][1](info, data);
      if (irc.listeners[i][2])
      {
        irc.listeners.splice(i, 1);
      }
    }
    if (irc.listeners[i] == "string that is being listened for")
    {
      irc.msg("#solidoodle", "Test,test,test"); 
    }
  }
}

I've been trying to match this to some of the talk I've been watching it receive in the console. Am I doing anything obviously wrong? I know I'll need some Regexs to make it work well.

irc.listeners is plainly an array whose elements are arrays (though it looks like making it an array of objects would be a better design, since you're using "magic numbers" to index the sub-elements), but in the line if (irc.listeners[i] == "string that is being listened for") you're treating it as if it were an array of strings. I'm guessing you meant if (irc.listeners[i][someOtherMagicNumber] == ...

Once again, use objects, not sub-arrays, to represent each listener, and give their elements meaningful keys. Right now we're left guessing at what the first, second, and third elements of a listener are supposed to represent, and so will you if you need to revisit your code several months from now.

Also, under some conditions you're deleting an element from irc.listeners but then falling through into further tests of what will now be the next element. However, that next element will never be subject to the earlier tests, since the next iteration of the loop will skip past it. Removing or inserting elements from an array you're iterating over is quite tricky and easy to get wrong.