Documentation ¶
Index ¶
- type Campfire
- type Listener
- type Robot
- func (self *Robot) Hear(expStr string, callback func(*TextMessage))
- func (self *Robot) Receive(msg *TextMessage)
- func (self *Robot) RememberUser(user *User)
- func (self *Robot) Respond(expStr string, callback func(*TextMessage))
- func (self *Robot) Shutdown()
- func (self *Robot) UserForId(id int) *User
- type RobotAdapter
- type Shell
- type TextMessage
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct { Exp *regexp.Regexp Callback func(*TextMessage) }
func NewListener ¶
func NewListener(exp *regexp.Regexp, callback func(*TextMessage)) *Listener
func (*Listener) Test ¶
func (self *Listener) Test(msg *TextMessage) bool
type Robot ¶
type Robot struct {
// contains filtered or unexported fields
}
func (*Robot) Hear ¶
func (self *Robot) Hear(expStr string, callback func(*TextMessage))
func (*Robot) Receive ¶
func (self *Robot) Receive(msg *TextMessage)
func (*Robot) RememberUser ¶
func (*Robot) Respond ¶
func (self *Robot) Respond(expStr string, callback func(*TextMessage))
type RobotAdapter ¶
type RobotAdapter interface { Hear(string, func(*TextMessage)) Respond(string, func(*TextMessage)) Run() }
type TextMessage ¶
type TextMessage struct { Id int Body string CreatedAt string Send func(text string) Reply func(text string) Topic func(text string) // contains filtered or unexported fields }
func (*TextMessage) Matches ¶
func (self *TextMessage) Matches() []string
func (*TextMessage) RandomString ¶
func (self *TextMessage) RandomString(strings []string) string
func (*TextMessage) SetMatches ¶
func (self *TextMessage) SetMatches(matches []string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.