ircbot

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandAction

type CommandAction func(
	map[string]string,
	*hbot.Message,
	*IrcBot,
) bool

type IrcBot

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

This is the entrypoint for ircbot.

func Init

func Init(configFile string) (*IrcBot, error)

Initializes the bot. Pass it a configfile and you'll have in return a functioning instance of an IRC bot.

func (*IrcBot) AddBuiltins

func (irc *IrcBot) AddBuiltins(showHelp bool)

func (*IrcBot) AddCommand

func (irc *IrcBot) AddCommand(name string, action CommandAction) *triggers.Command

Adds a non-configured command to the registry, that can be then configured.

func (*IrcBot) Close added in v0.2.5

func (irc *IrcBot) Close() error

Disconnects the bot.

func (*IrcBot) Config

func (irc *IrcBot) Config() *bot.Configuration

Returns the configuration

func (*IrcBot) DB

func (irc *IrcBot) DB() *sql.DB

Returns the database handle. Useful in commands.

func (*IrcBot) Logger

func (irc *IrcBot) Logger() log.Logger

get the hellabot logger

func (*IrcBot) Msg added in v0.2.6

func (irc *IrcBot) Msg(who, what string)

Send a message to a user or channel

func (*IrcBot) RegisterCommands

func (irc *IrcBot) RegisterCommands(commands []*triggers.Command) error

func (*IrcBot) Reply

func (irc *IrcBot) Reply(m *hbot.Message, what string)

Reply to a message via IRC

func (*IrcBot) Run

func (irc *IrcBot) Run()

func (*IrcBot) Topic

func (irc *IrcBot) Topic(channel string, what string)

Change topic

Jump to

Keyboard shortcuts

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