Documentation ¶
Index ¶
- Constants
- func Destroy(c *Connection)
- type Connection
- func (c *Connection) Action(dest, msg string)
- func (c *Connection) AddCallback(event string, callback func(*Message))
- func (c *Connection) AddTrigger(t Trigger)
- func (c *Connection) ChMode(user, channel, mode string)
- func (c *Connection) Cmd(command string)
- func (c *Connection) Disconnect()
- func (c *Connection) HandleJoin(chans []string)
- func (c *Connection) HandleNickTaken()
- func (c *Connection) HandlePingPong()
- func (c *Connection) IsConnected() bool
- func (c *Connection) Join(channels []string)
- func (c *Connection) LogNotices()
- func (c *Connection) Msg(dest, msg string)
- func (c *Connection) MsgBulk(dest []string, msg string)
- func (c *Connection) NewNick(nick string)
- func (c *Connection) Notice(dest, msg string)
- func (c *Connection) Ping()
- func (c *Connection) Pong()
- func (c *Connection) Reply(m *Message, reply string)
- func (c *Connection) RunCallbacks(m *Message)
- func (c *Connection) RunTriggers(m *Message)
- func (c *Connection) SetDebugOutput(w io.Writer)
- func (c *Connection) SetLogOutput(w io.Writer)
- func (c *Connection) SetPassword(pass string)
- func (c *Connection) SetThrottle(d time.Duration)
- func (c *Connection) Start()
- func (c *Connection) Topic(channel, topic string)
- func (c *Connection) WaitFor(filter func(*Message) bool, cmd func(), timeout time.Duration, ...) (err error)
- type Message
- type Trigger
Constants ¶
const ( PRIVMSG = irc.PRIVMSG PING = irc.PING PONG = irc.PONG WELCOME = irc.RPL_WELCOME NICKTAKEN = irc.ERR_NICKNAMEINUSE JOIN = irc.JOIN KICK = irc.KICK NOTICE = irc.NOTICE //Useful if you wanna check for activity ANYMESSAGE = "ANY" )
Map event codes
Variables ¶
This section is empty.
Functions ¶
func Destroy ¶ added in v1.1.0
func Destroy(c *Connection)
Destroy terminates monitor goroutines created by New()
Types ¶
type Connection ¶
type Connection struct { Nick string User string RealN string Server string TLS bool Password string Throttle time.Duration ConnTimeout time.Duration //Fake Connected status DebugFakeConn bool Log *log.Logger Debug *log.Logger Errchan chan error Send chan string sync.WaitGroup // contains filtered or unexported fields }
Connection Settings
func (*Connection) Action ¶
func (c *Connection) Action(dest, msg string)
Action sends an action to 'dest' (user or channel)
func (*Connection) AddCallback ¶
func (c *Connection) AddCallback(event string, callback func(*Message))
AddCallback Adds callback to an event
func (*Connection) ChMode ¶
func (c *Connection) ChMode(user, channel, mode string)
ChMode is used to change users modes in a channel operator = "+o" deop = "-o" ban = "+b"
func (*Connection) HandleJoin ¶
func (c *Connection) HandleJoin(chans []string)
HandleJoin joins channels on welcome
func (*Connection) HandleNickTaken ¶
func (c *Connection) HandleNickTaken()
HandleNickTaken changes nick when nick taken
func (*Connection) HandlePingPong ¶
func (c *Connection) HandlePingPong()
HandlePingPong replies to and sends pings
func (*Connection) IsConnected ¶
func (c *Connection) IsConnected() bool
IsConnected returns connection status
func (*Connection) MsgBulk ¶
func (c *Connection) MsgBulk(dest []string, msg string)
MsgBulk sends message to many
func (*Connection) Notice ¶
func (c *Connection) Notice(dest, msg string)
Notice sends a NOTICE message to 'dest' (user or channel)
func (*Connection) Reply ¶
func (c *Connection) Reply(m *Message, reply string)
Reply replies to a message
func (*Connection) SetDebugOutput ¶
func (c *Connection) SetDebugOutput(w io.Writer)
SetDebugOutput sets debug logger writer
func (*Connection) SetLogOutput ¶
func (c *Connection) SetLogOutput(w io.Writer)
SetLogOutput sets logger writer
func (*Connection) SetPassword ¶
func (c *Connection) SetPassword(pass string)
SetPassword sets the irc password
func (*Connection) SetThrottle ¶
func (c *Connection) SetThrottle(d time.Duration)
SetThrottle sets post delay
func (*Connection) Topic ¶
func (c *Connection) Topic(channel, topic string)
Topic sets the channel 'channel' topic (requires bot has proper permissions)