code: func NewStateMachine(p *Plugin) *StateMachine {
  	sm := StateMachine{
  		state:  0,
  		plugin: p,
  	}
  	sm.states = map[string]int{}
  	sm.resetFn = func(*Msg) {}
  	return &sm
  }
docs: // NewStateMachine initializes a stateMachine to its starting state.