bot

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func NewBot

func NewBot(logger *logrus.Logger, config *oodle.Config, ircClient *IRCClient, db *gorm.DB) *Bot

func (*Bot) Register added in v0.2.0

func (bot *Bot) Register(plugins ...interface{})

func (*Bot) RegisterCommand

func (bot *Bot) RegisterCommand(command oodle.Command)

func (*Bot) RegisterTrigger

func (bot *Bot) RegisterTrigger(trigger oodle.Trigger)

func (*Bot) Start added in v0.2.0

func (bot *Bot) Start() error

Start makes a conn., stats a readloop and uses the config

func (*Bot) Stop

func (bot *Bot) Stop()

Stop stops the bot in a graceful manner

type IRCClient added in v0.3.0

type IRCClient struct {
	Server   string
	Port     int
	Channel  string
	Nick     string
	Name     string
	User     string
	SASLUser string
	SASLPass string
	Retry    bool
	// contains filtered or unexported fields
}

func NewIRCClient added in v0.3.0

func NewIRCClient(log *logrus.Logger, conf *oodle.Config) *IRCClient

func (*IRCClient) Close added in v0.3.0

func (irc *IRCClient) Close()

Close closes the connection

func (*IRCClient) Connect added in v0.3.0

func (irc *IRCClient) Connect() error

func (*IRCClient) OnEvent added in v0.3.0

func (irc *IRCClient) OnEvent(callback func(event interface{}))

OnEvent registers a callback

func (*IRCClient) Send added in v0.3.0

func (irc *IRCClient) Send(message string)

Send sends an msg to the configured channel

func (*IRCClient) Sendf added in v0.6.0

func (irc *IRCClient) Sendf(format string, a ...interface{})

Sendf works like printf but for irc msgs.

Jump to

Keyboard shortcuts

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