Documentation
¶
Overview ¶
Package gotirc contains functions for connecting to Twitch.tv chat via IRC
Package gotirc contains functions for connecting to Twitch.tv chat via IRC
Index ¶
- type Client
- func (c *Client) Connect(nick string, pass string) error
- func (c *Client) Connected() bool
- func (c *Client) Disconnect()
- func (c *Client) Join(channel string)
- func (c *Client) OnAction(callback func(channel string, tags map[string]string, msg string))
- func (c *Client) OnChat(callback func(channel string, tags map[string]string, msg string))
- func (c *Client) OnCheer(callback func(channel string, tags map[string]string, msg string))
- func (c *Client) OnJoin(callback func(channel, username string))
- func (c *Client) OnPart(callback func(channel, username string))
- func (c *Client) OnResub(callback func(channel string, tags map[string]string, msg string))
- func (c *Client) OnSubGift(callback func(channel string, tags map[string]string, msg string))
- func (c *Client) OnSubscription(callback func(channel string, tags map[string]string, msg string))
- func (c *Client) Part(channel string)
- func (c *Client) Say(channel string, msg string)
- func (c *Client) Whisper(user string, msg string)
- type Message
- type Options
- type Prefix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds state and context information to maintain a connection with a server
func (*Client) Connect ¶
Connect connects the client to the server specified in the options and uses the supplied nick and pass (oauth token) to authenticate. Connect blocks and runs event callbacks until disconnected
func (*Client) Connected ¶
Connected returns true if the client is currently connected to the server, false otherwise
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
Disconnect closes the client's connection with the server
func (*Client) Join ¶
Join tells the client to join a particular channel. If the "#" prefix is missing, it is automatically prepended.
func (*Client) OnSubGift ¶
OnSubGift adds an event callback for when a user gifts a sub to a user in a channel
func (*Client) OnSubscription ¶
OnSubscription adds an event callback for when a user subscribes to a channel
func (*Client) Part ¶
Part tells the client to part a particular channel. If the "#" prefix is missing, it is automatically prepended.
type Message ¶
type Message struct {
Raw string
Prefix Prefix
Command string
Params []string
Tags map[string]string
}
Message holds data received from the server
func NewMessage ¶
NewMessage parses received IRC data into a Message