Documentation ¶
Index ¶
- Variables
- func ParseMessage(line string) (string, *User, *Message)
- type Client
- func (c *Client) Connect() error
- func (c *Client) Depart(channel string)
- func (c *Client) Disconnect() error
- func (c *Client) Join(channel string)
- func (c *Client) OnConnect(callback func())
- func (c *Client) OnNewClearchatMessage(callback func(channel string, user User, message Message))
- func (c *Client) OnNewMessage(callback func(channel string, user User, message Message))
- func (c *Client) OnNewNoticeMessage(callback func(channel string, user User, message Message))
- func (c *Client) OnNewRoomstateMessage(callback func(channel string, user User, message Message))
- func (c *Client) OnNewUnsetMessage(callback func(rawMessage string))
- func (c *Client) OnNewUsernoticeMessage(callback func(channel string, user User, message Message))
- func (c *Client) OnNewUserstateMessage(callback func(channel string, user User, message Message))
- func (c *Client) OnNewWhisper(callback func(user User, message Message))
- func (c *Client) OnUserJoin(callback func(channel, user string))
- func (c *Client) OnUserPart(callback func(channel, user string))
- func (c *Client) Say(channel, text string)
- func (c *Client) SetIRCToken(ircToken string)
- func (c *Client) Userlist(channel string) ([]string, error)
- func (c *Client) Whisper(username, text string)
- type Emote
- type Message
- type MessageType
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClientDisconnected returned from Connect() when a Disconnect() was called ErrClientDisconnected = errors.New("client called Disconnect()") // ErrLoginAuthenticationFailed returned from Connect() when either the wrong or a malformed oauth token is used ErrLoginAuthenticationFailed = errors.New("login authentication failed") )
Functions ¶
Types ¶
type Client ¶
Client client to control your connection and attach callbacks
func (*Client) OnConnect ¶
func (c *Client) OnConnect(callback func())
OnConnect attach callback to when a connection has been established
func (*Client) OnNewClearchatMessage ¶
OnNewClearchatMessage attach callback to new messages such as timeouts
func (*Client) OnNewMessage ¶
OnNewMessage attach callback to new standard chat messages
func (*Client) OnNewNoticeMessage ¶
OnNewNoticeMessage attach callback to new notice message such as hosts
func (*Client) OnNewRoomstateMessage ¶
OnNewRoomstateMessage attach callback to new messages such as submode enabled
func (*Client) OnNewUnsetMessage ¶
OnNewUnsetMessage attaches callback to messages that didn't parse properly. Should only be used if you're debugging the message parsing
func (*Client) OnNewUsernoticeMessage ¶
OnNewUsernoticeMessage attach callback to new usernotice message such as sub, resub, and raids
func (*Client) OnNewUserstateMessage ¶
OnNewUserstateMessage attach callback to new userstate
func (*Client) OnNewWhisper ¶
OnNewWhisper attach callback to new whisper
func (*Client) OnUserJoin ¶
OnUserJoin attaches callback to user joins
func (*Client) OnUserPart ¶
OnUserPart attaches callback to user parts
func (*Client) SetIRCToken ¶
SetIRCToken updates the oauth token for this client used for authentication This will not cause a reconnect, but is meant more for "on next connect, use this new token" in case the old token has expired
type Message ¶
type Message struct { Type MessageType Time time.Time Action bool Emotes []*Emote Tags map[string]string Text string Raw string ChannelID string }
Message data you receive from tmi
type MessageType ¶
type MessageType int
MessageType different message types possible to receive via IRC
const ( // UNSET default type UNSET MessageType = -1 // WHISPER private messages WHISPER MessageType = 0 // PRIVMSG standard chat message PRIVMSG MessageType = 1 // CLEARCHAT timeout messages CLEARCHAT MessageType = 2 // ROOMSTATE changes like sub mode ROOMSTATE MessageType = 3 // USERNOTICE messages like subs, resubs, raids, etc USERNOTICE MessageType = 4 // USERSTATE messages USERSTATE MessageType = 5 // NOTICE messages like sub mode, host on NOTICE MessageType = 6 )