victor

package module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2014 License: MIT Imports: 17 Imported by: 14

README

Victor

Build Status

Victor is a library for creating your own chat bot.

We use Victor as the backbone of our bot, Virbot, within our team Slack chat at Virb (http://virb.com). We use him for all sorts things like:

  • Deploying code
  • Preparing/initiating builds of our projects
  • Viewing information about our infrastructure
  • CDN operations
  • Jokes and laughs

Supported Services

I currently have adapters written for Slack and Campfire, however more are to come. Writing an adapter for your favorite service is a good way to contribute to the project 😉.

Making Him Your Own

Victor is more of a framework for constructing your own bot so he doesn't do a whole lot out-of-the-box. I'll be adding more default behavior to him as time progresses. You can use the programs located in examples/ as starting points to create your own executable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatch added in v0.3.1

type Dispatch struct {
	// contains filtered or unexported fields
}

func NewDispatch added in v0.3.1

func NewDispatch(bot *Robot) *Dispatch

func (*Dispatch) Handle added in v0.3.1

func (d *Dispatch) Handle(exp string, h Handler)

func (*Dispatch) HandleFunc added in v0.3.1

func (d *Dispatch) HandleFunc(exp string, f func(*State))

func (*Dispatch) Process added in v0.3.1

func (d *Dispatch) Process(m chat.Message)

type Handler added in v0.3.1

type Handler interface {
	Handle(*State)
}

type HandlerFunc added in v0.3.1

type HandlerFunc func(*State)

func (HandlerFunc) Handle added in v0.3.1

func (f HandlerFunc) Handle(s *State)

type Robot

type Robot struct {
	*Dispatch
	// contains filtered or unexported fields
}

func New

func New(adapterName, robotName, httpAddr string) *Robot

New returns a Robot

func (*Robot) Chat added in v0.3.1

func (r *Robot) Chat() chat.Adapter

func (*Robot) Direct added in v0.3.1

func (r *Robot) Direct(exp string) string

Direct wraps a regexp pattern in the necessary pattern for a direct command to the bot.

func (*Robot) HTTP added in v0.3.1

func (r *Robot) HTTP() *mux.Router

func (*Robot) Name added in v0.3.1

func (r *Robot) Name() string

func (*Robot) Receive added in v0.3.1

func (r *Robot) Receive(m chat.Message)

func (*Robot) Run

func (r *Robot) Run() error

Run starts the robot.

func (*Robot) SetChat added in v0.3.1

func (r *Robot) SetChat(name string) error

func (*Robot) SetHTTP added in v0.3.1

func (r *Robot) SetHTTP(router *mux.Router)

func (*Robot) SetName added in v0.3.1

func (r *Robot) SetName(n string)

func (*Robot) SetStore added in v0.3.1

func (r *Robot) SetStore(s store.Store)

func (*Robot) Stop added in v0.3.1

func (r *Robot) Stop()

func (*Robot) Store added in v0.3.1

func (r *Robot) Store() store.Store

type State added in v0.3.1

type State struct {
	// contains filtered or unexported fields
}

func (*State) Chat added in v0.3.1

func (s *State) Chat() chat.Adapter

func (*State) Message added in v0.3.1

func (s *State) Message() chat.Message

func (*State) Params added in v0.3.1

func (s *State) Params() []string

func (*State) Robot added in v0.3.1

func (s *State) Robot() *Robot

Directories

Path Synopsis
examples
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL