Wait for a numeric on IRC notifications

Code originally by Nick Markwell (@duckinator), ported to the current
codebase by me. This is a port of the code in #56.

This should fix travis-ci/travis-ci#436.