Socket-level IRC Bot in Python