overhaul of Bot class to be a state machine