oodle

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 5 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 girc.Event))
	Sender
	Checker
}

IRCClient is a simplified client given to plugins.

type Join

type Join struct {
	Nick string
}

type Joined added in v1.16.0

type Joined struct{}

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)
	Sendnl(message string)
	SendTo(user, message string)
	Sendf(format string, a ...interface{})
}

type Trigger

type Trigger func(event girc.Event)

Trigger is a basic event handler

Jump to

Keyboard shortcuts

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