Versions in this module Expand all Collapse all v1 v1.2.2 Aug 15, 2022 v1.2.1 Aug 15, 2022 Changes in this version + type BotCommand interface + Definition func() *CommandDefinition + Execute func(botCtx BotContext, request Request, response ResponseWriter) + Interactive func(*Slacker, *socketmode.Event, *slack.InteractionCallback, *socketmode.Request) + Match func(text string) (*proper.Properties, bool) + Tokenize func() []*commander.Token + Usage func() string + func NewBotCommand(usage string, definition *CommandDefinition) BotCommand + type BotContext interface + Client func() *slack.Client + Context func() context.Context + Event func() *MessageEvent + SocketMode func() *socketmode.Client + func NewBotContext(ctx context.Context, client *slack.Client, socketmode *socketmode.Client, ...) BotContext + type BotInteractionMode int + const BotInteractionModeIgnoreAll + const BotInteractionModeIgnoreApp + const BotInteractionModeIgnoreNone + type ClientDefaults struct + BotMode BotInteractionMode + Debug bool + type ClientOption func(*ClientDefaults) + func WithBotInteractionMode(mode BotInteractionMode) ClientOption + func WithDebug(debug bool) ClientOption + type CommandDefinition struct + AuthorizationFunc func(botCtx BotContext, request Request) bool + BlockID string + Description string + Examples []string + Handler func(botCtx BotContext, request Request, response ResponseWriter) + HideHelp bool + Interactive func(*Slacker, *socketmode.Event, *slack.InteractionCallback, *socketmode.Request) + type CommandEvent struct + Command string + Event *MessageEvent + Parameters *proper.Properties + Timestamp time.Time + func NewCommandEvent(command string, parameters *proper.Properties, event *MessageEvent) *CommandEvent + type MessageEvent struct + BotID string + Channel string + ChannelName string + Data interface{} + Text string + ThreadTimeStamp string + TimeStamp string + Type string + User string + UserName string + func (e *MessageEvent) IsBot() bool + func (e *MessageEvent) IsThread() bool + type ReplyDefaults struct + Attachments []slack.Attachment + Blocks []slack.Block + ThreadResponse bool + func NewReplyDefaults(options ...ReplyOption) *ReplyDefaults + type ReplyOption func(*ReplyDefaults) + func WithAttachments(attachments []slack.Attachment) ReplyOption + func WithBlocks(blocks []slack.Block) ReplyOption + func WithThreadReply(useThread bool) ReplyOption + type ReportErrorDefaults struct + ThreadResponse bool + func NewReportErrorDefaults(options ...ReportErrorOption) *ReportErrorDefaults + type ReportErrorOption func(*ReportErrorDefaults) + func WithThreadError(useThread bool) ReportErrorOption + type Request interface + BooleanParam func(key string, defaultValue bool) bool + FloatParam func(key string, defaultValue float64) float64 + IntegerParam func(key string, defaultValue int) int + Param func(key string) string + Properties func() *proper.Properties + StringParam func(key string, defaultValue string) string + func NewRequest(botCtx BotContext, properties *proper.Properties) Request + type ResponseWriter interface + Reply func(text string, options ...ReplyOption) error + ReportError func(err error, options ...ReportErrorOption) + func NewResponse(botCtx BotContext) ResponseWriter + type Slacker struct + func NewClient(botToken, appToken string, options ...ClientOption) *Slacker + func (s *Slacker) BotCommands() []BotCommand + func (s *Slacker) CleanEventInput(cei func(in string) string) + func (s *Slacker) Client() *slack.Client + func (s *Slacker) Command(usage string, definition *CommandDefinition) + func (s *Slacker) CommandEvents() <-chan *CommandEvent + func (s *Slacker) CustomBotContext(...) + func (s *Slacker) CustomCommand(...) + func (s *Slacker) CustomRequest(...) + func (s *Slacker) CustomResponse(responseConstructor func(botCtx BotContext) ResponseWriter) + func (s *Slacker) DefaultCommand(...) + func (s *Slacker) DefaultEvent(defaultEventHandler func(interface{})) + func (s *Slacker) DefaultInnerEvent(defaultInnerEventHandler func(interface{})) + func (s *Slacker) Err(errorHandler func(err string)) + func (s *Slacker) GetUserInfo(user string) (*slack.User, error) + func (s *Slacker) Help(definition *CommandDefinition) + func (s *Slacker) Init(initHandler func()) + func (s *Slacker) Interactive(...) + func (s *Slacker) Listen(ctx context.Context) error + func (s *Slacker) SocketMode() *socketmode.Client + func (s *Slacker) UnAuthorizedError(errUnauthorized error)