When your bot joins it doesn't parse server input after NICK and USER. It's really a miracle that you got it to work.
Also, your regex is kind of messed up. /^.*!quit(.*)$/i. In the first bit '/^.*' the .* will match any character, 0 or more times making the '^' meaningless. The (.*) is also unneeded. If you want to make sure you've got input coming from a channel, use something like: /^: (.*?)!.*: $text/, $text being !quit in your case. (the nick will also be in $1)
Also, your regex is kind of messed up. /^.*!quit(.*)$/i. In the first bit '/^.*' the .* will match any character, 0 or more times making the '^' meaningless. The (.*) is also unneeded. If you want to make sure you've got input coming from a channel, use something like: /^: (.*?)!.*: $text/, $text being !quit in your case. (the nick will also be in $1)