victor

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 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

func New

func New(config Config) *robot

New returns a robot

func OnlyAllow added in v0.4.1

func OnlyAllow(userNames []string, action func(s State)) func(State)

OnlyAllow provides a way of permitting specific users to execute a handler registered with the bot

Types

type Config added in v0.4.1

type Config struct {
	Name,
	ChatAdapter,
	StoreAdapter,
	HTTPAddr string
}

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 interface {
	Run()
	Stop()
	Name() string
	HandleFunc(string, HandlerFunc)
	Handle(string, Handler)
	Direct(string) string
	Receive(chat.Message)
	Chat() chat.Adapter
	Store() store.Adapter
	HTTP() *mux.Router
}

type State added in v0.3.1

type State interface {
	Robot() Robot
	Chat() chat.Adapter
	Message() chat.Message
	Params() []string
}

Directories

Path Synopsis
examples
pkg

Jump to

Keyboard shortcuts

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