oodle

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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 {
	RegisterCommands(plugins ...Command)
	RegisterTriggers(plugins ...Trigger)
	Commands() []Command
}

Bot handles trigger/command execution

type Checker added in v1.2.0

type Checker interface {
	IsRegistered(nick string) bool
	InChannel(nick string) bool
	IsAdmin(nick string) bool
}

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()
	OnEvent(callback func(event interface{}))
	Sender
	Checker
}

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 Sender added in v0.6.0

type Sender interface {
	Send(message string)
	SendTo(user, message string)
	Sendf(format string, a ...interface{})
}

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