Documentation ¶
Index ¶
- type Bot
- func Classic(server string, name string) *Bot
- func New(server, name string, config Config) *Bot
- func WithLogin(server string, name string, user string, password string) *Bot
- func WithLoginTLS(server string, name string, user string, password string, ...) *Bot
- func WithTLS(server string, name string, tlsConfig *tls.Config) *Bot
- func (b *Bot) Connect() error
- func (b *Bot) Handle(cmd string, handler Handler)
- func (b *Bot) HandleFunc(cmd string, handler func(s Sender, m *irc.Message))
- func (b *Bot) HandleLoop()
- func (b *Bot) Logger() log.Logger
- func (b *Bot) ReadLoop() error
- func (b *Bot) Reconnect() error
- func (b *Bot) SetLogger(l log.Logger)
- type Config
- type Handler
- type HandlerFunc
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { Server string OriginalName string Config Config Data chan *irc.Message Sender Sender // contains filtered or unexported fields }
Bot contains all of the information necessary to run a single IRC client
func Classic ¶
Classic creates an instance of ircx poised to connect to the given server with the given IRC name.
func WithLogin ¶
WithLogin creates an instance with the specified server, name user and password for the IRC server
func WithLoginTLS ¶
func WithLoginTLS(server string, name string, user string, password string, tlsConfig *tls.Config) *Bot
WithLoginTLS creates an instance with the specified information + TLS config
func WithTLS ¶
WithTLS creates an instance of ircx poised to connect to the given server using TLS with the given IRC name.
func (*Bot) HandleFunc ¶
HandleFunc registers the handler function for the given command
func (*Bot) HandleLoop ¶
func (b *Bot) HandleLoop()
HandleLoop reads from the ReadLoop channel and initiates a handler check for every message it recieves.
func (*Bot) ReadLoop ¶
ReadLoop sets a timeout of 300 seconds, and then attempts to read from the IRC server. If there is an error, it calls Reconnect
type HandlerFunc ¶
HandlerFunc is a type that represents the method necessary to implement Handler