Documentation
¶
Overview ¶
Package ircon maintains a connection to the Twitch IRC service.
Index ¶
Constants ¶
View Source
const DefaultCaps = "twitch.tv/tags twitch.tv/commands"
DefaultCaps is the default set of capabilities. The twitch.tv/membership capability is omitted for performance reasons and its general lack of usefulness in most scenarios.
View Source
const DefaultServer = "wss://irc-ws.chat.twitch.tv/"
DefaultServer is the default Twitch "IRC" server used by e.g. web chat
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
// Connected is called when a connection is fully established and the
// connection is ready to send messages.
Connected()
// Disconnected is called when an active connection ends, potentially due
// to an error. It will also be called when establishing a connection
// fails, before it was fully Connected.
Disconnected(err error)
// Message is called for every incoming message. Note that it can be called
// before Connected or after Disconnected are called.
Message(*irc.Message)
}
A Handler receives events from IRCon.
type IRCon ¶
type IRCon struct {
// Caps contains the set of capabilities that are requested on connect.
// Advanced users can specify their own set.
Caps string
Handler Handler
// contains filtered or unexported fields
}
An IRCon is an automatically reconnecting IRC connection.
func (*IRCon) Background ¶
Background runs the connection in a background goroutine until ctx is done.
func (*IRCon) Nick ¶ added in v0.1.3
Nick returns the username or anonymous nickname used for this connection.
Source Files
¶
- expcd.go
- ircon.go
Click to show internal directories.
Click to hide internal directories.