Documentation ¶
Index ¶
- Constants
- type Config
- type Event
- type Mouse
- func (mouse *Mouse) Ban(channel, user, reason string) error
- func (mouse *Mouse) Connect() error
- func (mouse *Mouse) Deop(channel, nick string) error
- func (mouse *Mouse) Join(channel string) error
- func (mouse *Mouse) Kick(channel, user, reason string) error
- func (mouse *Mouse) Op(channel, nick string) error
- func (mouse *Mouse) Part(channel string) error
- func (mouse *Mouse) Say(channel, message string) error
- func (mouse *Mouse) Unban(channel, user string) error
- func (mouse *Mouse) Use(handler func(*Event))
Constants ¶
const ( ConnectionWaiting = iota ConnectionAlive ConnectionDead )
Connection constants represent different stages of a connection.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string Port int Nick string User string Name string Pass string Channels []string Reconnect bool Ping time.Duration TLS bool TLSConfig *tls.Config Storage storage.Storage StorageDriver string }
A Config represents a configuration object for a Mouse
type Event ¶
type Event struct { Channel string Command string Host string Message string Nick string User string }
An Event represents an IRC event
type Mouse ¶
type Mouse struct { Config *Config Storage *storage.Store // contains filtered or unexported fields }
A Mouse represents an IRC bot
func New ¶
New creates a new IRC bot. If there are any problems creating the bot, or connecting to storage, this returns an error.
func (*Mouse) Ban ¶
Ban allows the bot to ban a user out of a specific channel. While you must pass a parameter as a reason, if you don't want to send an actual reason, you can pass an empty string.
func (*Mouse) Connect ¶
Connect creates a new connection to the IRC server defined in the Config. If there are any problems connecting, this will return an error.
func (*Mouse) Deop ¶
Deop allows the bot to change the mode to -o of a user given in a specific channel.
func (*Mouse) Join ¶
Join allows the bot to join a channel. If there is a password for the channel the bot is trying to join, append it with a space after the channel name.
func (*Mouse) Kick ¶
Kick allows the bot to kick a user out of a specific channel. While you must pass a parameter as a reason, if you don't want to send an actual reason, you can pass an empty string.
func (*Mouse) Op ¶
Op allows the bot to change the mode to +o of a user given in a specific channel.