You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if it is Robeaux issue or if I missed something. I modify the hello_api_auth example, go to localhost:3000, add key/value and hit RUN, the key/value didn't seem to pass back to hello_api_auth. I have modified "hello.AddCommand" block to check what does "params" contain but it return "map[]"
package main
import (
"fmt"
"html"
"net/http"
"gobot.io/x/gobot"
"gobot.io/x/gobot/api"
)
func main() {
master := gobot.NewMaster()
a := api.NewAPI(master)
a.AddHandler(api.BasicAuth("gort", "klatuu"))
a.Debug()
a.AddHandler(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q \n", html.EscapeString(r.URL.Path))
})
a.Start()
master.AddCommand("custom_gobot_command",
func(params map[string]interface{}) interface{} {
return "This command is attached to the mcp!"
})
hello := master.AddRobot(gobot.NewRobot("hello"))
hello.AddCommand("hi_there", func(params map[string]interface{}) interface{} {
fmt.Println(params)
return fmt.Sprintf("This command is attached to the robot %v", hello.Name)
})
master.Start()
}
The text was updated successfully, but these errors were encountered:
I don't know if it is Robeaux issue or if I missed something. I modify the hello_api_auth example, go to localhost:3000, add key/value and hit RUN, the key/value didn't seem to pass back to hello_api_auth. I have modified "hello.AddCommand" block to check what does "params" contain but it return "map[]"
The text was updated successfully, but these errors were encountered: