start with 'roll your own IRC bot' tutorial source
working IRC bot