gobot

package module
v0.0.0-...-5ff6ee9 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 5 Imported by: 0

README

gobot

Golang chat robot.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAdapter

func RegisterAdapter(name string, newadapter Adapter)

func RegisterWorker

func RegisterWorker(name string, worker Worker)

Types

type Adapter

type Adapter interface {
	Init(gobot *Gobot) error

	Start()

	Send(text string) error

	SendToChat(text, chatroom string) error

	Reply(orgmessage *payload.Message, text string) error
}

type Gobot

type Gobot struct {
	Name string

	ConfigPath string
	// contains filtered or unexported fields
}

func NewDefaultGobot

func NewDefaultGobot(botname string) *Gobot

func (*Gobot) Receive

func (bot *Gobot) Receive(message *payload.Message)

func (*Gobot) Reply

func (bot *Gobot) Reply(orimessage *payload.Message, text string) error

func (*Gobot) Send

func (bot *Gobot) Send(text string)

func (*Gobot) SendToChat

func (bot *Gobot) SendToChat(text, chatroom string)

func (*Gobot) StartGoBot

func (bot *Gobot) StartGoBot() error

func (*Gobot) Stop

func (bot *Gobot) Stop()

type Worker

type Worker interface {
	Init(gobot *Gobot) error
	Process(gobot *Gobot, message *payload.Message) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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