handlers

package
v0.0.0-...-a495c7a Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetHostname

func AssetHostname(c *Context, m *slack.MessageEvent) (bool, error)

func AssetTag

func AssetTag(c *Context, m *slack.MessageEvent) (bool, error)

func Help

func Help(c *Context, m *slack.MessageEvent) (bool, error)

func YouAlive

func YouAlive(c *Context, m *slack.MessageEvent) (bool, error)

Types

type Context

type Context struct {
	Collins  *collins.Client
	Self     *slack.AuthTestResponse
	Slack    *slack.Slack
	Handlers []Handler
	// contains filtered or unexported fields
}

func New

func New(client *collins.Client, self *slack.AuthTestResponse, api *slack.Slack, handlers []Handler) *Context

func (*Context) Handle

func (c *Context) Handle(m *slack.MessageEvent)

func (*Context) Register

func (c *Context) Register(handler string, f func(*Context, *slack.MessageEvent) (bool, error))

TODO i couldnt figure out how to make the handler functions of signature (*Context)func(*slack.MessageEvent)(bool,error) and actually invoke the method on some specific object. So, i moved the context into the arglist. fuck it

func (*Context) Run

func (c *Context) Run()

func (*Context) WTFHandler

func (c *Context) WTFHandler(m *slack.MessageEvent) (bool, error)

type Handler

type Handler struct {
	Name     string
	Function func(*Context, *slack.MessageEvent) (bool, error)
}

Jump to

Keyboard shortcuts

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