Documentation ¶
Index ¶
Constants ¶
const TypeInternal = "internal"
TypeInternal is only used internally to identify internal slack messages. todo(matze) do not use it anymore
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bot ¶ added in v1.6.0
type Bot struct {
// contains filtered or unexported fields
}
func NewBot ¶
func NewBot(cfg config.Config, slackClient *client.Slack, logger *log.Logger, commands *Commands) *Bot
NewBot created main Bot struct which holds the slack connection and dispatch messages to commands
func (*Bot) DisconnectRTM ¶ added in v1.6.0
DisconnectRTM will do a clean shutdown and kills all connections
func (*Bot) HandleMessages ¶ added in v1.6.0
HandleMessages is blocking method to handle new incoming events
type Command ¶
Command is the main command struct which needs to provide the matcher and the actual executed action
type Commands ¶
type Commands struct {
// contains filtered or unexported fields
}
Commands is a wrapper of a list of commands. Only the first matched command will be executed
func (*Commands) AddCommand ¶
AddCommand registers a command to the command list
type Conditional ¶
type Conditional interface {
IsEnabled() bool
}
Conditional checks if the command should be activated. E.g. is dependencies are not present or it's disabled in the config
type Help ¶
Help command can provide help objects which are searchable by keywords
func (Help) GetKeywords ¶
GetKeywords crates a string slice of help keywords -> used by fuzzy search
type HelpProvider ¶
type HelpProvider interface { // each command should provide information, like a description or examples GetHelp() []Help }
HelpProvider can be provided by a command to add information within "help" command