Writing an IRC bot in Python