Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot structure
func New ¶
func New(sc *slack.Client, tc *trace.Client, devMode bool, log Logger, h Handler, jh JoinHandler) *Bot
New will create a new Bot.
type HandlerFunc ¶
HandlerFunc adapts a function to be a Handler.
type JoinHandler ¶
type JoinHandler interface {
Handle(ctx context.Context, event *slack.TeamJoinEvent, r JoinResponder)
}
A JoinHandler responds to a user joining the Slack team.
type JoinHandlerFunc ¶
type JoinHandlerFunc func(ctx context.Context, event *slack.TeamJoinEvent, r JoinResponder)
JoinHandlerFunc adapts a function to be a JoinHandler.
func (JoinHandlerFunc) Handle ¶
func (jh JoinHandlerFunc) Handle(ctx context.Context, event *slack.TeamJoinEvent, r JoinResponder)
Handle calls jh(ctx, event, r).
type JoinResponder ¶
JoinResponder provides methods for responding to a user joing the Slack team.
type Message ¶
type Message struct { Event *slack.MessageEvent // OriginalEvent TrimmedText string // Event.Text with whitespace and bot mention removed. DirectedToBot bool // True if @mention to bot or DM to bot. }
Message contains the slack.MessageEvent and processed information.
type Responder ¶
type Responder interface { Respond(ctx context.Context, msg string) RespondUnfurled(ctx context.Context, msg string) RespondWithAttachment(ctx context.Context, msg, attachment string) RespondPrivate(ctx context.Context, msg string) RespondPrivateWithAttachment(ctx context.Context, msg, attachment string) React(ctx context.Context, reaction string) }
Responder provides methods for responding to messages.
Click to show internal directories.
Click to hide internal directories.