twitch

package
v0.0.0-...-6b3fda4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 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 ActionTaker

type ActionTaker interface {
	Condition(payload bot.Item, bot *bot.Bot) bool
	Action(payload bot.Item, bot *bot.Bot, messenger bot.Messenger) error
}

type CommandAction

type CommandAction struct{}

func (*CommandAction) Action

func (ca *CommandAction) Action(item bot.Item, bot *bot.Bot, messenger bot.Messenger) error

Action for a CommandAction defines the actions that can be made with a command

func (*CommandAction) Condition

func (ca *CommandAction) Condition(item bot.Item, bot *bot.Bot) bool

type NoOpAction

type NoOpAction struct{}

NoopAction will be used as a placeholder when no other action was found

func (*NoOpAction) Action

func (noop *NoOpAction) Action(item bot.Item, bot *bot.Bot, messenger bot.Messenger) error

Action for a NoOpAction returns a nil error, in other words, this is a stub that does nothing

func (*NoOpAction) Condition

func (noop *NoOpAction) Condition(item bot.Item, bot *bot.Bot) bool

type QuoteAction

type QuoteAction struct{}

func (*QuoteAction) Action

func (qa *QuoteAction) Action(item bot.Item, bot *bot.Bot, messenger bot.Messenger) error

func (*QuoteAction) Condition

func (qa *QuoteAction) Condition(item bot.Item, bot *bot.Bot) bool

type TimerAction

type TimerAction struct{}

func (*TimerAction) Action

func (ta *TimerAction) Action(item bot.Item, bot *bot.Bot, messenger bot.Messenger) error

func (*TimerAction) Condition

func (ta *TimerAction) Condition(item bot.Item, bot *bot.Bot) bool

type Twitch

type Twitch struct {
	Bot *bot.Bot
}

func (*Twitch) Handler

func (t *Twitch) Handler(item bot.Item, defaultActions []ActionTaker) error

Handler will contain the root logic for handling any kind of message from twitch; whether from the IRC server itself, or messages from the Twitch chat

func (*Twitch) Message

func (t *Twitch) Message(msg string) error

func (*Twitch) Run

func (t *Twitch) Run() error

Run defines the main entry point for a Twitch bot

Jump to

Keyboard shortcuts

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