oodle

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commit = ""
View Source
var ErrUsage = errors.New("Wrong command usage")
View Source
var Version = ""

Functions

func SetDefaults added in v1.0.0

func SetDefaults()

Types

type Bot

type Bot interface {
	// Register registers Trigger/Command only.
	Register(plugins ...interface{})
	Commands() []Command
}

Bot handles trigger/command execution

type Command

type Command struct {
	Prefix      string
	Name        string
	Description string
	Usage       string
	Fn          func(nick string, args []string) (reply string, err error)
}

type Deps added in v1.0.0

type Deps struct {
	IRC    IRCClient
	Bot    Bot
	DB     *sql.DB
	Logger *logrus.Logger
}

Deps is a container for common dependencies

type IRCClient added in v0.7.2

type IRCClient interface {
	Connect() error
	Close()
	IsRegistered(nick string) bool
	InChannel(nick string) bool
	IsAdmin(nick string) bool
	OnEvent(callback func(event interface{}))
	Send(message string)
	Sendf(format string, a ...interface{})
}

IRCClient is a simplified client given to plugins.

type Join

type Join struct {
	Nick string
}

type Leave

type Leave struct {
	Nick string
}

type Message

type Message struct {
	Nick string
	Msg  string
}

Simpified IRC events

type Trigger

type Trigger func(event interface{})

Trigger is a basic event handler

Jump to

Keyboard shortcuts

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