Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot is the main object used to interact with Hipchat
func NewBot ¶
NewBot creates a new Bot instance. Please note that Jabber ID and nickname must match the ones in the Hipchat acoount settings
func (*Bot) Answer ¶
Answer sends a message back to a room if the original message was a chatgroup, or directly to a user otherwise
func (*Bot) JoinRoom ¶
JoinRoom tries to make the bot join a specific room. Room ID must match the one reported in the hipchat website
func (*Bot) KeepAlive ¶
func (b *Bot) KeepAlive()
KeepAlive launches a goroutine that keeps the connection from closing
func (*Bot) Listen ¶
Listen waits forever for incoming messages and relays them to the passed-in listener
func (*Bot) SendDirect ¶
SendDirect sends a message directly to one user
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux works pretty similarly to gorilla-mux and similar constructs. You can register pairs of regex-function, so each time an incoming message matches a regex, the relevant function will be called
func (*Mux) AddHandler ¶
func (m *Mux) AddHandler(regex string, f HandleFunc)
AddHandler registers a function to be called when an incoming message matches the regex