Documentation ¶
Index ¶
- func REPL(name, prefix string)
- type Broker
- func (cb Broker) GetTopic(roomId string) (string, error)
- func (cb Broker) Leave(roomId string) error
- func (cb Broker) LooksLikeRoomId(room string) bool
- func (cb Broker) LooksLikeUserId(user string) bool
- func (cb Broker) Name() string
- func (b Broker) RoomIdToName(in string) string
- func (b Broker) RoomNameToId(in string) string
- func (cb Broker) Send(e hal.Evt)
- func (cb Broker) SendDM(e hal.Evt)
- func (cb Broker) SendTable(e hal.Evt, hdr []string, rows [][]string)
- func (cb Broker) SetTopic(roomId, topic string) error
- func (cb Broker) SimpleStdin()
- func (cb Broker) SimpleStdout()
- func (cb Broker) Stream(out chan *hal.Evt)
- func (b Broker) UserIdToName(in string) string
- func (b Broker) UserNameToId(in string) string
- type Config
- type SlashReaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func REPL ¶
func REPL(name, prefix string)
REPL starts a readline-like bot REPL on the console. All plugins that are present and registered are automatically enabled. name should be a non-empty string. It is reported as the room name/id and will be the string in the REPL prompt, e.g. "foo" -> "foo> ". If prefix is set, it is prepended to every line so you can do, e.g. REPL("foo", "!foo") and every line in the REPL will show up in the hal Evt.Body as "!foo <whatever>". To avoid this, set it to empty string. This will start 2 goroutines.
Types ¶
type Broker ¶
func (Broker) LooksLikeRoomId ¶
func (Broker) LooksLikeUserId ¶
func (Broker) RoomNameToId ¶
func (Broker) SimpleStdin ¶
func (cb Broker) SimpleStdin()
SimpleStdin will loop forever reading stdin and publish each line as an event in the console broker. e.g. go cbroker.SimpleStdin()
func (Broker) SimpleStdout ¶
func (cb Broker) SimpleStdout()
SimpleStdout prints all replies, etc to the broker on os.Stdout. e.g. go cbroker.SimpleStdout()
func (Broker) UserIdToName ¶
func (Broker) UserNameToId ¶
type SlashReaction ¶
type SlashReaction string