code: func Register(p *dt.Plugin) error {
  	p.Log.Debug("registering", p.Config.Name)
  	for _, i := range p.Trigger.Intents {
  		s := "I_" + strings.ToLower(i)
  		oldPlg := core.RegPlugins.Get(s)
  		if oldPlg != nil && oldPlg.Config.Name != p.Config.Name {
  			p.Log.Infof("found duplicate plugin or trigger %s on %s",
  				p.Config.Name, s)
  		}
  		core.RegPlugins.Set(s, p)
  	}
  	eng := porter2.Stemmer
  	for _, c := range p.Trigger.Commands {
  		c = strings.ToLower(eng.Stem(c))
  		for _, o := range p.Trigger.Objects {
  			o = strings.ToLower(eng.Stem(o))
  			s := "CO_" + c + "_" + o
  			oldPlg := core.RegPlugins.Get(s)
  			if oldPlg != nil && oldPlg.Config.Name != p.Config.Name {
  				p.Log.Info("found duplicate plugin or trigger",
  					p.Config.Name, "on", s)
  			}
  			core.RegPlugins.Set(s, p)
  		}
  	}
  
  	// registerPlugin is called whenever Keywords or Triggers are changed,
  	// but we don't want to append duplicate entries to our
  	// core.AllPlugins.
  	for _, plg := range core.AllPlugins {
  		if plg.Config.Name == p.Config.Name {
  			return nil
  		}
  	}
  	core.AllPlugins = append(core.AllPlugins, p)
  	p.SM.SetStates([][]dt.State{p.States})
  	return nil
  }
docs: // Register enables Abot to notify plugins when specific StructuredInput is
  // encountered matching triggers set in the plugins themselves. Note that
  // plugins will only listen when (Command and Object) or (Intent) criteria are
  // met. There's no support currently for duplicate routes, e.g.
  // "find_restaurant" leading to either one of two plugins.