Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { Run(func(ev Event) error) error SendCustom(CustomEvent) error }
App is the top level for a chat application. Call Run with an event handling function to start the application.
type BlockUI ¶
type BlockUI interface { Header(message string) PlainText(text string) Markdown(text string) TextInput(label string, hint string, placeholder string) string MultilineTextInput(label string, hint string, placeholder string) string Divider() Select(title string, options []Option) string MultipleSelect(title string, options []Option) []string Button(label string) bool }
BlockUI allows the creation of Slack blocks in a message or modal.
type CustomEvent ¶
type CustomEvent interface {
Body() map[string]interface{}
}
type Event ¶
type Event interface { Connected() bool Custom() CustomEvent ReceiveMessage() ReceivedMessage SlashCommand(command string) SlashCommand JoinChannel(channelID string) SendMessage(channelID string) Message }
Event represents an event received from the Slack platform. It provides functions representing each type of event that can be received. For example, ReceivedMessage will return a message that may have been received in this event. Functions will return nil if the current event does not match the type of event.
type Message ¶
Message represents a message that can be sent to Slack. Messages are constructed using BlockUI commands.
type Modal ¶
type Modal interface { BlockUI Submit(title string) ModalSubmission Close(title string) bool }
Modal represents a Slack modal view. It can be used to create blocks and handle submission or closing of the modal.
type ModalCreator ¶
ModalCreator is an interface that can be used to create Slack modal views.
type ModalSubmission ¶
ModalSubmission handles a modal being submitted. It can be used to send a response message or push a new modal onto the stack.
type ReceivedMessage ¶
ReceivedMessage represents a message received from Slack.
type SlashCommand ¶
type SlashCommand interface { Metadata ModalCreator }
SlashCommand represents a received slash command. Messages and modal views may be created in response to the command.