Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnswerRegexp = regexp.MustCompile(
`^!(?i:answer\s+)?([^\s]+)\s*$`,
)
A regular expression that matches a message that's providing an answer. Capture group 1 is the answer.
View Source
var DefaultSpellingBeeHTTPClient = &http.Client{ Timeout: 1 * time.Second, }
The HTTP client to use when communicating with the api service from the spelling bee integration.
View Source
var ShuffleRegexp = regexp.MustCompile(
`^!(?i:shuffle)\s*$`,
)
A regular expression that matches a message that's asking for the letters to be shuffled into a new order. There are no capture groups.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
func NewMessageHandler ¶
func NewMessageHandler(host string) *MessageHandler
func (*MessageHandler) HandleChannelMessage ¶
func (h *MessageHandler) HandleChannelMessage(channel, status, message string)
HandleChannelMessage parses a message and if it matches a spelling bee command sends it to the appropriate API endpoint.
Click to show internal directories.
Click to hide internal directories.