Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// Events is the channel where all events arrive after being handled by the
// registered handlers.
Events chan Event
// Errors is the channel were all connection and post-connection errors are
// sent for handling by the user.
Errors chan error
// contains filtered or unexported fields
}
Bot is an abstraction over Twitch IRC that facilitates the creation of command-driven chat bots.
func NewBot ¶
func NewBot(opts *BotOptions) (*Bot, error)
NewBot sets up a Bot with the provided options and opens its channels.
func (*Bot) AddHandler ¶
Add handler registers an event handler function on the bot's handler map.
type BotOptions ¶
BotOptions are the values needed for connecting the bot to a channel/user
type Event ¶
type Event struct {
// Type is an arbitrary string to describe the type of event.
Type string
// UserID is the ID of the user that issued the event.
UserID string
// Username is the username of the user that issued the event.
Username string
// Data is any additional data that needs to be attached to the event.
Data any
}
Event abstracts a single event produced by a Handler after its defined trigger is detected by the IRC listener.
type Message ¶ added in v0.0.1
type Message twitch.PrivateMessage
Message is a facade type over twitch.PrivateMessage so that users don't need to explicitly import the go-twitch-irc package when adding handlers.
Click to show internal directories.
Click to hide internal directories.