update agent readme
This commit is contained in:
parent
02d580600d
commit
e41a461c8b
@ -15,7 +15,7 @@ Commands are functions executed by the bot based on text based pattern matching.
|
|||||||
### Write a Command
|
### Write a Command
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/micro/go-bot/command"
|
import "github.com/micro/go-micro/agent/command"
|
||||||
|
|
||||||
func Ping() command.Command {
|
func Ping() command.Command {
|
||||||
usage := "ping"
|
usage := "ping"
|
||||||
@ -32,7 +32,7 @@ func Ping() command.Command {
|
|||||||
Add the command to the Commands map with a pattern key that can be matched by golang/regexp.Match
|
Add the command to the Commands map with a pattern key that can be matched by golang/regexp.Match
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/micro/go-bot/command"
|
import "github.com/micro/go-micro/agent/command"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
command.Commands["^ping$"] = Ping()
|
command.Commands["^ping$"] = Ping()
|
||||||
@ -116,7 +116,7 @@ is executed, the bot will call the service with method `Command.Exec`. It also e
|
|||||||
to exist for usage info.
|
to exist for usage info.
|
||||||
|
|
||||||
|
|
||||||
The service interface is as follows and can be found at [go-bot/proto](https://github.com/micro/go-bot/blob/master/proto/bot.proto)
|
The service interface is as follows and can be found at [go-micro/agent/proto](https://github.com/micro/go-micro/agent/blob/master/proto/bot.proto)
|
||||||
|
|
||||||
```
|
```
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
@ -160,7 +160,7 @@ import (
|
|||||||
"github.com/micro/go-micro"
|
"github.com/micro/go-micro"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
|
||||||
proto "github.com/micro/go-bot/proto"
|
proto "github.com/micro/go-micro/agent/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Command struct{}
|
type Command struct{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user