bot

package
v0.5.32 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProgrammingQuoteName = "prog-quote-bot"
	CatQuoteName         = "cat-quote-bot"
)
View Source
const BTCName = "btc-bot"
View Source
const HolidayName = "holiday-bot"
View Source
const HueName = "hue-bot"
View Source
const TriviaName = "trivia-bot"
View Source
const (
	WttrName = "wttr-bot"
)

Variables

View Source
var ErrNotExists = errors.New("no such bot")

Functions

func CatQuote

func CatQuote(user string, args ...string) (string, string, error)

func ProgrammingQuote

func ProgrammingQuote(user string, args ...string) (string, string, error)

Types

type BTCBot added in v0.3.13

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

func NewBTCBot added in v0.3.13

func NewBTCBot() (*BTCBot, error)

func (*BTCBot) Message added in v0.3.13

func (btc *BTCBot) Message(user string, args ...string) (string, string, error)

type Bot

type Bot interface {
	Message(user string, args ...string) (string, string, error)
}

func NewBotFunc

func NewBotFunc(f Messager) Bot

type BotCollection

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

func NewBotCollection

func NewBotCollection(name string) *BotCollection

func (*BotCollection) AddBot

func (c *BotCollection) AddBot(command string, bot Bot)

func (*BotCollection) Commands

func (c *BotCollection) Commands() string

func (*BotCollection) Message

func (c *BotCollection) Message(user string, args ...string) (string, string, error)

type BotFunc

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

func (*BotFunc) Message

func (f *BotFunc) Message(user string, args ...string) (string, string, error)

type HolidayBot

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

func NewHolidayBot

func NewHolidayBot(countryCode string) *HolidayBot

func (*HolidayBot) Message

func (h *HolidayBot) Message(user string, args ...string) (string, string, error)

type HueBot

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

func NewHueBot

func NewHueBot(ip, pass string, groupExcludes []string) *HueBot

func (*HueBot) Init

func (h *HueBot) Init() error

func (*HueBot) Message

func (h *HueBot) Message(user string, args ...string) (string, string, error)

type Messager

type Messager func(user string, args ...string) (string, string, error)

type TriviaBot

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

func NewTriviaBot

func NewTriviaBot() *TriviaBot

func (*TriviaBot) Message

func (t *TriviaBot) Message(user string, args ...string) (string, string, error)

type WttrBot

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

func NewWttrBot

func NewWttrBot(defaultCity string) *WttrBot

func (*WttrBot) Message

func (w *WttrBot) Message(user string, args ...string) (string, string, error)

Jump to

Keyboard shortcuts

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