spellingbee

package
v0.0.0-...-4308b5e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL