Documentation ¶
Index ¶
- Variables
- func IgnoreCommand(_ *Client, _ *Message) error
- type Client
- func (client *Client) Backoff()
- func (client *Client) Connect() error
- func (client *Client) Forever()
- func (client *Client) Join(channel string) error
- func (client *Client) Loop() error
- func (client *Client) Part(channel string) error
- func (client *Client) Receive() (*Message, error)
- func (client *Client) Send(message *Message) (int, error)
- func (client *Client) SendRegistration() error
- type CommandCallback
- type Message
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardCommandCallbacks = map[string]CommandCallback{ "001": IgnoreCommand, "002": IgnoreCommand, "003": IgnoreCommand, "004": IgnoreCommand, "005": IgnoreCommand, "353": IgnoreCommand, "366": IgnoreCommand, "372": IgnoreCommand, "375": IgnoreCommand, "376": IgnoreCommand, "CAP": IgnoreCommand, "JOIN": IgnoreCommand, "PART": IgnoreCommand, "ROOMSTATE": IgnoreCommand, "NOTICE": IgnoreCommand, "USERNOTICE": IgnoreCommand, "CLEARCHAT": IgnoreCommand, "PING": func(client *Client, message *Message) error { _, err := client.Send(&Message{ Command: "PONG", Arguments: message.Arguments, }) return err }, "RECONNECT": func(client *Client, _ *Message) error { _, err := client.Send(&Message{Command: "QUIT"}) return err }, }
Functions ¶
func IgnoreCommand ¶
Types ¶
type Client ¶
type Client struct { Username string Token string Connection *tls.Conn Reader *bufio.Reader Channels map[string]int ChannelsMutex sync.Mutex CommandCallbacks map[string]CommandCallback ReconnectAttempts int }
func NewAnonClient ¶
func NewAnonClient() *Client
func (*Client) SendRegistration ¶
type CommandCallback ¶
type Message ¶
type Message struct { Badges map[string]int Channel string Message string Tags map[string]string Source string Command string Arguments []string }
func ParseMessage ¶
func (*Message) IsBroadcaster ¶
func (*Message) IsModerator ¶
func (*Message) IsModeratorOrBroadcaster ¶
Click to show internal directories.
Click to hide internal directories.