1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00

24 lines
439 B
Go
Raw Normal View History

2013-11-27 20:05:45 -08:00
package main
import (
"fmt"
"github.com/hybridgroup/gobot"
2014-05-22 20:18:45 -07:00
"github.com/hybridgroup/gobot/api"
2013-11-27 20:05:45 -08:00
)
func main() {
2014-06-07 20:57:51 -07:00
master := gobot.NewGobot()
2014-06-11 16:44:23 -07:00
a := api.NewAPI(master)
a.Start()
2013-11-27 20:05:45 -08:00
2014-05-22 20:18:45 -07:00
hello := gobot.NewRobot("hello", nil, nil, nil)
2014-06-11 16:44:23 -07:00
hello.AddCommand("HiThere", func(params map[string]interface{}) interface{} {
return []string{fmt.Sprintf("Hey"), fmt.Sprintf("dude!")}
})
2013-11-27 20:05:45 -08:00
2014-04-16 15:54:39 -07:00
master.Robots = append(master.Robots, hello)
2013-11-27 20:05:45 -08:00
master.Start()
}