By accessing the the array using the index 2, you are accessing the third element in the array since arrays start at 0. When you split your message by :, you’re only splitting the string into 2 parts, so you’d want to access second element at index 1.
That would be the quick fix. Although I’d recommend making your parsing a little more flexible to handle various kinds of IRC messages.