Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnswerRegexp = regexp.MustCompile(
`^!(?i:answer\s+)?([0-9]+[aAdD])\s+(.*)\s*$`,
)
A regular expression that matches a message that's providing an answer. Capture group 1 is the clue and capture group 2 is the answer.
View Source
var DefaultCrosswordHTTPClient = &http.Client{ Timeout: 1 * time.Second, }
The HTTP client to use when communicating with the api service from the crossword integration.
View Source
var ShowClueRegexp = regexp.MustCompile(
`^!(?i:show)\s+(?P<clue>[0-9]+[aAdD])\s*$`,
)
A regular expression that matches a message that's asking for a clue to be made visible. Capture group 1 is the clue.
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 crossword command sends it to the appropriate API endpoint.
Click to show internal directories.
Click to hide internal directories.