Documentation
¶
Overview ¶
Package flockerbot implements a simple IRC bot. To use it, populate a Bot struct and call Connect() on it. To send messages, use the SendString and SendStruct methods. For receiving messages, make sure the handler field is set. The handler function will be called on reception of messages, with the message struct as the parameter.
Index ¶
- Variables
- type Bot
- func (b *Bot) Connect() (err, loopError error)
- func (b *Bot) Connected() bool
- func (b *Bot) CurrentNick() string
- func (b *Bot) Disconnect() error
- func (b *Bot) Error() error
- func (b *Bot) ReplyTo(msg *irc.Message) string
- func (b *Bot) SendString(msg string)
- func (b *Bot) SendStruct(msg *irc.Message)
- func (b *Bot) SetAutoReconnect(v bool)
- func (b *Bot) Setup()
- func (b *Bot) StayConnected() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTimeout signals timeout ErrTimeout = errors.New("Bot: Timeout") )
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { ConnectAddress string // where to connect to. IP:Port. User string // Username for USER command. Nick string // Nickname for NICK command. Password string // Password for authentication. If empty, no authentication will be used. IsServer bool // Register as server, not client. User field is used as the server name. Timeout int64 // Connect and ping timeout. TLS bool // connect via TLS Handler func(msg *irc.Message) // Handler for messages. The handler will not be called for PING, 001 and 443 messages. ConnectedHandler func() // Handler that is called on connect ErrChan chan error // Channel to send errors to // contains filtered or unexported fields }
Bot implements the bot
func (*Bot) CurrentNick ¶
CurrentNick returns the actual nick of the connection.
func (*Bot) Error ¶
Error returns the last error generated by Connect. To be used in goroutine scenarios.
func (*Bot) StayConnected ¶
StayConnected keeps the bot connected
Directories
¶
Path | Synopsis |
---|---|
Package fixbuffer implements a buffered reader over a fixed size buffer
|
Package fixbuffer implements a buffered reader over a fixed size buffer |
Package ringbuffer implements ringbuffer calculations.
|
Package ringbuffer implements ringbuffer calculations. |
Click to show internal directories.
Click to hide internal directories.