Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAccessibilityLabel(label string) map[string]any
- func BuildAccessoryImage(imageURL, altText string) map[string]any
- func BuildActionsBlock(elements []map[string]any) []map[string]any
- func BuildAdvancedLayout(title string, fields map[string]string, footer string) []map[string]any
- func BuildApprovalBlock(requestID, title, description string) []map[string]interface{}
- func BuildButton(text, actionID, value string, style string) map[string]any
- func BuildButtonWithURL(text, actionID, url string) map[string]any
- func BuildButtonWithURLValidation(text, actionID, rawURL string) (map[string]any, error)
- func BuildButtonWithValidation(text, actionID, value string, style string) (map[string]any, error)
- func BuildCallBlock(callID string) []map[string]any
- func BuildChannelMention(channelID string) map[string]any
- func BuildCheckboxes(options []map[string]any, actionID string, initialOptions []map[string]any) map[string]any
- func BuildConfirmationBlock(title, message string) []map[string]interface{}
- func BuildConfirmationDialog(title, text, confirmText, denyText string) map[string]any
- func BuildConfirmationDialogWithStyle(title, text, confirmText, denyText, style string) map[string]any
- func BuildContextActionsBlock(contextItems []map[string]any, actions []map[string]any) []map[string]any
- func BuildContextBlock(elements []map[string]any) []map[string]any
- func BuildConversationFilter(include []string, excludeBotUsers, excludeExternalSharedChannels bool) map[string]any
- func BuildConversationsSelectWithFilter(placeholder, actionID string, filter map[string]any, ...) map[string]any
- func BuildDatePicker(placeholder, actionID string, initialDate string) map[string]any
- func BuildDeliveryPolicy(persistence string) map[string]any
- func BuildDispatchActionConfig(triggerActions []string) map[string]any
- func BuildDividerBlock() []map[string]any
- func BuildElementWithValidation(elemType, actionID string, validateFunc func() error) (map[string]any, error)
- func BuildEmoji(name string) map[string]any
- func BuildExternalSelectWithMinQuery(placeholder, actionID string, minQueryLength int, initialOption map[string]any) map[string]any
- func BuildFeedbackButtons(positiveActionID, negativeActionID string) map[string]any
- func BuildFileBlock(externalID string) []map[string]any
- func BuildFileInput(actionID string, filetypes []string, maxFiles int) map[string]any
- func BuildFilter(includeTypes []string, excludeExternalSharedChannels bool) map[string]any
- func BuildHeaderBlock(text string) []map[string]any
- func BuildIconButton(iconName string, actionID string, confirm map[string]any) map[string]any
- func BuildImageBlock(imageURL, altText, title string) []map[string]any
- func BuildInputBlock(label, placeholder string, element map[string]any, optional bool) map[string]any
- func BuildLink(text, url string) map[string]any
- func BuildMarkdownBlock(markdownText string) []map[string]any
- func BuildMrkdwnText(text string, verbatim bool) map[string]any
- func BuildMultiEmailInput(actionID, placeholder string, maxValues int) map[string]any
- func BuildOption(label, value string) map[string]any
- func BuildOptionGroup(label string, options []map[string]any) map[string]any
- func BuildOptionWithDescription(label, value, description string) map[string]any
- func BuildOptionWithValidation(label, value string) (map[string]any, error)
- func BuildPermissionApprovedBlocks(tool, input string) []map[string]any
- func BuildPermissionDeniedBlocks(tool, input, reason string) []map[string]any
- func BuildPermissionRequestBlocks(req *provider.PermissionRequest, sessionID string) []map[string]any
- func BuildPlainText(text string, emoji bool) map[string]any
- func BuildPlainTextInput(placeholder, actionID string, initialValue string, multiline bool, ...) map[string]any
- func BuildPlainTextInputWithValidation(placeholder, actionID, initialValue string, multiline bool, ...) (map[string]any, error)
- func BuildPlanBlock(title string, sections []map[string]any) []map[string]any
- func BuildPlanItem(text string, itemType string) map[string]any
- func BuildPlanSection(sectionTitle string, items []map[string]any, status string) map[string]any
- func BuildRadioButtons(options []map[string]any, actionID string, initialOption map[string]any) map[string]any
- func BuildResponseURLPlaceholder(actionID string) map[string]any
- func BuildRichTextBlock(elements []map[string]any) []map[string]any
- func BuildRichTextElement(elementType string, text string) map[string]any
- func BuildRichTextInput(actionID, placeholder string, initialValue string, focusOnLoad bool) map[string]any
- func BuildRichTextList(elements []map[string]any, style string) map[string]any
- func BuildRichTextPreformatted(elements []map[string]any) map[string]any
- func BuildRichTextQuote(elements []map[string]any) map[string]any
- func BuildRichTextRange(start, end int, style map[string]any) map[string]any
- func BuildRichTextSection(elements []map[string]any) map[string]any
- func BuildRichTextSectionBold(text string) map[string]any
- func BuildRichTextSectionCode(text string) map[string]any
- func BuildRichTextSectionItalic(text string) map[string]any
- func BuildRichTextSectionLink(text, url string) map[string]any
- func BuildRichTextSectionText(text string) map[string]any
- func BuildSectionBlock(text string, fields []map[string]any, accessory map[string]any) []map[string]any
- func BuildSectionBlockWithFields(fields []map[string]any) []map[string]any
- func BuildSelectionBlock(title string, options []SelectionOption) []map[string]interface{}
- func BuildSlackFileObject(id string, url string) map[string]any
- func BuildStaticSelect(options []map[string]any, placeholder, actionID string, ...) map[string]any
- func BuildStyleObject(bold, italic, strike, code bool) map[string]any
- func BuildTableBlock(headers []string, rows [][]string, columns int) []map[string]any
- func BuildTaskCardBlock(title, description, assignee, dueDate, status string, actions []map[string]any) []map[string]any
- func BuildTriggerObject(interactiveTrigger string) map[string]any
- func BuildURLSource(actionID, url string) (map[string]any, error)
- func BuildURLSourceUnsafe(actionID, url string) map[string]any
- func BuildUserMention(userID string) map[string]any
- func BuildVideoBlock(videoURL, thumbnailURL, title, description string, ...) []map[string]any
- func BuildWorkflowButton(text string, workflow struct{ ... }, style string) map[string]any
- func BuildWorkflowObject(workflowID string, inputs map[string]any) map[string]any
- func ChunkMessageMarkdown(text string, limit int) []string
- func FormatChannelAllMention() string
- func FormatChannelMention(channelID, channelName string) string
- func FormatChannelMentionByID(channelID string) string
- func FormatCommand(command string) string
- func FormatDate(timestamp int64) string
- func FormatDateLong(timestamp int64) string
- func FormatDateShort(timestamp int64) string
- func FormatDateTime(timestamp int64, format, fallback string) string
- func FormatDateTimeCombined(timestamp int64) string
- func FormatDateTimeWithLink(timestamp int64, format, linkURL, fallback string) string
- func FormatEmail(email string) string
- func FormatEveryoneMention() string
- func FormatHereMention() string
- func FormatObject(objectType, objectID, objectText string) string
- func FormatSpecialMention(mentionType string) string
- func FormatSubteamMention(subteamID, subteamHandle string) string
- func FormatTime(timestamp int64) string
- func FormatURL(url, text string) string
- func FormatUserMention(userID, userName string) string
- func FormatUserMentionByID(userID string) string
- func IsAllowedScheme(scheme string) bool
- func NewContextWithTraceID(ctx context.Context) (context.Context, string)
- func RateLimitKey(userID, ip string) string
- func RuneCount(s string) int
- func SanitizeCommand(command string) string
- func SanitizeErrorMessage(err error) string
- func SanitizeForDisplay(content string, maxLength int) string
- func SanitizeForRegex(input string) string
- func SanitizeMarkdown(content string) string
- func TraceIDFromContext(ctx context.Context) string
- func TruncateByRune(s string, maxRunes int) string
- func TruncateMrkdwn(text string, maxLen int) string
- func TruncateText(text string, maxLen int) string
- func ValidateAccessibilityLabel(label string) error
- func ValidateActionID(actionID string) error
- func ValidateAndTruncateBlocks(blocks []map[string]any) ([]map[string]any, error)
- func ValidateBlock(block map[string]any, index int) error
- func ValidateBlockID(blockID string) string
- func ValidateBlockWithDetails(block map[string]any, index int) []error
- func ValidateBlocks(blocks []map[string]any, isModal bool) error
- func ValidateButtonComplete(button map[string]any) error
- func ValidateButtonURL(buttonURL string) error
- func ValidateButtonURLLength(buttonURL string) error
- func ValidateButtonValue(value string) (string, string, string, error)
- func ValidateComplete(block map[string]any) error
- func ValidateConfirmationDialog(title, text, confirmText, denyText string) (string, string, string, string)
- func ValidateConfirmationDialogText(title, text, confirmText, denyText string) (string, string, string, string)
- func ValidateEmailFormat(email string) bool
- func ValidateEmoji(text string, allowEmoji bool) string
- func ValidateFileComplete(file map[string]any) error
- func ValidateFileInput(element map[string]any) error
- func ValidateImageComplete(image map[string]any) error
- func ValidateImageURL(imageURL string) error
- func ValidateInitialValue(initialValue string, maxLength int) string
- func ValidateInitialValueForInput(initialValue string, maxLength int) string
- func ValidateMentionFormat(mention string) bool
- func ValidateMrkdwnText(text string) string
- func ValidateOptionValue(value string) error
- func ValidatePlainText(text string, withEmoji bool) string
- func ValidatePlanBlock(block map[string]any) error
- func ValidateRegexPattern(pattern string) (string, error)
- func ValidateRichTextInput(element map[string]any) error
- func ValidateTableBlock(block map[string]any) error
- func ValidateTaskCardBlock(block map[string]any) error
- func ValidateTextObject(text map[string]any) error
- func ValidateTokenFormat(token string) bool
- func ValidateToolName(toolName string) string
- func ValidateURL(rawURL string) error
- func ValidateURLFormat(rawURL string) bool
- func WithFocusOnLoad(element map[string]any) map[string]any
- func WithTraceID(ctx context.Context, traceID string) context.Context
- type Adapter
- func (a *Adapter) AddReaction(ctx context.Context, reaction base.Reaction) error
- func (a *Adapter) SendAttachment(ctx context.Context, channelID, threadTS string, attachment base.Attachment) error
- func (a *Adapter) SendMessage(ctx context.Context, sessionID string, msg *base.ChatMessage) error
- func (a *Adapter) SendMessageWithOptions(ctx context.Context, sessionID string, msg *MessageContent, ...) error
- func (a *Adapter) SendToChannel(ctx context.Context, channelID, text, threadTS string) error
- func (a *Adapter) SetEngine(eng *engine.Engine)
- func (a *Adapter) SetSender(fn func(ctx context.Context, sessionID string, msg *base.ChatMessage) error)
- func (a *Adapter) SetSlashCommandHandler(fn func(cmd SlashCommand))
- func (a *Adapter) Start(ctx context.Context) error
- func (a *Adapter) Stop() error
- func (a *Adapter) UpdateMessage(ctx context.Context, channelID, messageTS string, blocks []any, ...) error
- type BlockBuilder
- func (b *BlockBuilder) BuildAnswerBlock(content string) []map[string]any
- func (b *BlockBuilder) BuildChunkedAnswerBlocks(content string) [][]map[string]any
- func (b *BlockBuilder) BuildChunkedSectionBlocks(text string) [][]map[string]any
- func (b *BlockBuilder) BuildDividerBlock() []map[string]any
- func (b *BlockBuilder) BuildErrorBlock(message string, isDangerBlock bool) []map[string]any
- func (b *BlockBuilder) BuildSessionStatsBlock(stats *event.SessionStatsData, style SessionStatsStyle) []map[string]any
- func (b *BlockBuilder) BuildStatsBlock(stats *event.EventMeta) []map[string]any
- func (b *BlockBuilder) BuildThinkingBlock(content string) []map[string]any
- func (b *BlockBuilder) BuildToolResultBlock(success bool, durationMs int64, output string, hasButton bool) []map[string]any
- func (b *BlockBuilder) BuildToolUseBlock(toolName, input string, truncated bool) []map[string]any
- type CallbackChannel
- type CallbackMessage
- type CallbackTeam
- type CallbackUser
- type Config
- type ErrorClass
- type Event
- type EventHandler
- type MessageContent
- type MessageEvent
- type MrkdwnFormatter
- type RateLimitError
- type RetryConfig
- type SelectionOption
- type SendMessageOptions
- type SessionStatsStyle
- type SlackAction
- type SlackInteractionCallback
- type SlashCommand
- type SlashCommandRateLimiter
- type SocketModeConfig
- type SocketModeConnection
- func (s *SocketModeConnection) IsConnected() bool
- func (s *SocketModeConnection) RegisterHandler(eventType string, handler EventHandler)
- func (s *SocketModeConnection) Send(data map[string]any) error
- func (s *SocketModeConnection) SetReconnectCallbacks(onReconnect func(), onReconnectFail func(error))
- func (s *SocketModeConnection) Start(ctx context.Context) error
- func (s *SocketModeConnection) Stop() error
- type ValidationError
Constants ¶
const ( MaxSectionTextLen = 3000 MaxBlocksLen = 50 MaxModalBlocksLen = 100 MaxFieldTextLen = 2000 MaxBlockIDLen = 255 MaxMarkdownBlockLen = 12000 MaxPlainTextLen = 150 MaxButtonActionIDLen = 255 MaxButtonTextLen = 75 )
Slack Block Kit character limits (from official documentation)
const SlackTextLimit = 4000
SlackTextLimit is the maximum character limit for a single Slack message
const SocketModeURL = "wss://wss.slack.com/ws"
SocketModeURL is the Slack Socket Mode WebSocket endpoint
Variables ¶
var ActionIDPattern = regexp.MustCompile(`^[a-zA-Z0-9_-]{1,255}$`)
ActionIDPattern validates action_id format (alphanumeric + _ - only, max 255 chars)
var AllowedFileTypes = map[string]bool{ "pdf": true, "doc": true, "docx": true, "xls": true, "xlsx": true, "ppt": true, "pptx": true, "txt": true, "rtfd": true, "zip": true, "mp3": true, "mov": true, "mp4": true, "wav": true, "key": true, }
AllowedFileTypes defines Slack-supported file extensions for file_input
var AllowedURLSchemes = []string{"http://", "https://", "mailto:", "ftp://"}
AllowedURLSchemes defines which URL schemes are allowed in links
var ButtonValuePattern = regexp.MustCompile(`^[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+$`)
ButtonValuePattern validates permission button values Format: behavior:sessionID:messageID (alphanumeric + _ - only)
Functions ¶
func BuildAccessibilityLabel ¶ added in v0.12.0
BuildAccessibilityLabel creates accessibility label for button
func BuildAccessoryImage ¶ added in v0.12.0
BuildAccessoryImage creates an image accessory for section blocks Reference: https://api.slack.com/reference/block-kit/composition-objects#image
func BuildActionsBlock ¶ added in v0.12.0
BuildActionsBlock creates an actions block with interactive elements Reference: https://api.slack.com/reference/block-kit/blocks#actions
func BuildAdvancedLayout ¶ added in v0.12.0
BuildAdvancedLayout creates a complex layout using section/fields combinations
func BuildApprovalBlock ¶ added in v0.12.0
BuildApprovalBlock creates a block with Approve/Reject buttons. Used for: dangerous command approval requests.
func BuildButton ¶ added in v0.12.0
BuildButton creates a button element
func BuildButtonWithURL ¶ added in v0.12.0
BuildButtonWithURL creates a button that opens a URL
func BuildButtonWithURLValidation ¶ added in v0.12.0
BuildButtonWithURLValidation creates a button with URL validation
func BuildButtonWithValidation ¶ added in v0.12.0
BuildButtonWithValidation creates a button with full validation
func BuildCallBlock ¶ added in v0.12.0
BuildCallBlock creates a call block for huddles/meetings Reference: https://api.slack.com/reference/block-kit/blocks#call
func BuildChannelMention ¶ added in v0.12.0
BuildChannelMention creates a channel mention for rich_text_section
func BuildCheckboxes ¶ added in v0.12.0
func BuildCheckboxes(options []map[string]any, actionID string, initialOptions []map[string]any) map[string]any
BuildCheckboxes creates a checkbox group
func BuildConfirmationBlock ¶ added in v0.12.0
BuildConfirmationBlock creates a simple confirmation message.
func BuildConfirmationDialog ¶ added in v0.12.0
BuildConfirmationDialog creates a confirmation dialog Reference: https://api.slack.com/reference/block-kit/composition-objects#confirm
func BuildConfirmationDialogWithStyle ¶ added in v0.12.0
func BuildConfirmationDialogWithStyle(title, text, confirmText, denyText, style string) map[string]any
BuildConfirmationDialogWithStyle creates a confirmation dialog with style (primary/danger)
func BuildContextActionsBlock ¶ added in v0.12.0
func BuildContextActionsBlock(contextItems []map[string]any, actions []map[string]any) []map[string]any
BuildContextActionsBlock creates a context actions block for quick actions Reference: https://api.slack.com/reference/block-kit/blocks#context-actions-block
func BuildContextBlock ¶ added in v0.12.0
BuildContextBlock creates a context block with multiple elements Reference: https://api.slack.com/reference/block-kit/blocks#context
func BuildConversationFilter ¶ added in v0.12.0
func BuildConversationFilter(include []string, excludeBotUsers, excludeExternalSharedChannels bool) map[string]any
BuildConversationFilter creates a filter for conversations select
func BuildConversationsSelectWithFilter ¶ added in v0.12.0
func BuildConversationsSelectWithFilter(placeholder, actionID string, filter map[string]any, defaultToCurrentConversation bool) map[string]any
BuildConversationsSelectWithFilter creates a conversations select with filter
func BuildDatePicker ¶ added in v0.12.0
BuildDatePicker creates a date picker
func BuildDeliveryPolicy ¶ added in v0.12.0
BuildDeliveryPolicy creates a delivery policy for messages
func BuildDispatchActionConfig ¶ added in v0.12.0
BuildDispatchActionConfig creates a dispatch action config for input elements Reference: https://api.slack.com/reference/block-kit/composition-objects#dispatch_action_config
func BuildDividerBlock ¶ added in v0.12.0
BuildDividerBlock creates a simple divider Reference: https://api.slack.com/reference/block-kit/blocks#divider
func BuildElementWithValidation ¶ added in v0.12.0
func BuildElementWithValidation(elemType, actionID string, validateFunc func() error) (map[string]any, error)
BuildElementWithValidation wraps element creation with validation
func BuildEmoji ¶ added in v0.12.0
BuildEmoji creates an emoji element for rich_text_section
func BuildExternalSelectWithMinQuery ¶ added in v0.12.0
func BuildExternalSelectWithMinQuery(placeholder, actionID string, minQueryLength int, initialOption map[string]any) map[string]any
BuildExternalSelectWithMinQuery creates an external select with minimum query length
func BuildFeedbackButtons ¶ added in v0.12.0
BuildFeedbackButtons creates thumbs up/down feedback buttons Reference: https://api.slack.com/reference/block-kit/block-elements#feedback-buttons-element
func BuildFileBlock ¶ added in v0.12.0
BuildFileBlock creates a file block (requires file to be uploaded first) Reference: https://api.slack.com/reference/block-kit/blocks#file
func BuildFileInput ¶ added in v0.12.0
BuildFileInput creates a file input element for file uploads Reference: https://api.slack.com/reference/block-kit/block-elements#file-input-element
func BuildFilter ¶ added in v0.12.0
BuildFilter creates a filter for conversations_select Reference: https://api.slack.com/reference/block-kit/composition-objects#filter_conversations
func BuildHeaderBlock ¶ added in v0.12.0
BuildHeaderBlock creates a header block (text must be plain_text, max 150 chars) Reference: https://api.slack.com/reference/block-kit/blocks#header
func BuildIconButton ¶ added in v0.12.0
BuildIconButton creates an icon-only button (minimal UI) Reference: https://api.slack.com/reference/block-kit/block-elements#icon-button-element
func BuildImageBlock ¶ added in v0.12.0
BuildImageBlock creates an image block Reference: https://api.slack.com/reference/block-kit/blocks#image
func BuildInputBlock ¶ added in v0.12.0
func BuildInputBlock(label, placeholder string, element map[string]any, optional bool) map[string]any
BuildInputBlock creates an input block for modals Reference: https://api.slack.com/reference/block-kit/blocks#input
func BuildMarkdownBlock ¶ added in v0.12.0
BuildMarkdownBlock creates a markdown block for rendering markdown content Reference: https://api.slack.com/reference/block-kit/blocks#markdown-block
func BuildMrkdwnText ¶ added in v0.12.0
BuildMrkdwnText creates a mrkdwn text object Reference: https://api.slack.com/reference/block-kit/composition-objects#text
func BuildMultiEmailInput ¶ added in v0.12.0
BuildMultiEmailInput creates a multi-email input field
func BuildOption ¶ added in v0.12.0
BuildOption creates an option object for select menus, radio buttons, checkboxes Reference: https://api.slack.com/reference/block-kit/composition-objects#option
func BuildOptionGroup ¶ added in v0.12.0
BuildOptionGroup creates an option group for select menus Reference: https://api.slack.com/reference/block-kit/composition-objects#option-group
func BuildOptionWithDescription ¶ added in v0.12.0
BuildOptionWithDescription creates an option with description
func BuildOptionWithValidation ¶ added in v0.12.0
BuildOptionWithValidation creates an option with validation
func BuildPermissionApprovedBlocks ¶ added in v0.12.0
BuildPermissionApprovedBlocks builds blocks to show after permission is approved.
func BuildPermissionDeniedBlocks ¶ added in v0.12.0
BuildPermissionDeniedBlocks builds blocks to show after permission is denied.
func BuildPermissionRequestBlocks ¶ added in v0.12.0
func BuildPermissionRequestBlocks(req *provider.PermissionRequest, sessionID string) []map[string]any
BuildPermissionRequestBlocks builds Slack Block Kit for a Claude Code permission request. It displays the tool name, command preview, and approval/denial buttons.
func BuildPlainText ¶ added in v0.12.0
BuildPlainText creates a plain_text text object
func BuildPlainTextInput ¶ added in v0.12.0
func BuildPlainTextInput(placeholder, actionID string, initialValue string, multiline bool, maxLength int, minLength int) map[string]any
BuildPlainTextInput creates a plain text input field
func BuildPlainTextInputWithValidation ¶ added in v0.12.0
func BuildPlainTextInputWithValidation(placeholder, actionID, initialValue string, multiline bool, maxLength, minLength int) (map[string]any, error)
BuildPlainTextInputWithValidation creates a plain text input with validation
func BuildPlanBlock ¶ added in v0.12.0
BuildPlanBlock creates a plan block for displaying structured plans Reference: https://api.slack.com/reference/block-kit/blocks#plan-block
func BuildPlanItem ¶ added in v0.12.0
BuildPlanItem creates an item for plan section
func BuildPlanSection ¶ added in v0.12.0
BuildPlanSection creates a section for plan block
func BuildRadioButtons ¶ added in v0.12.0
func BuildRadioButtons(options []map[string]any, actionID string, initialOption map[string]any) map[string]any
BuildRadioButtons creates a radio button group
func BuildResponseURLPlaceholder ¶ added in v0.12.0
BuildResponseURLPlaceholder creates a placeholder for response URLs
func BuildRichTextBlock ¶ added in v0.12.0
BuildRichTextBlock creates a rich_text block for formatted content Reference: https://api.slack.com/reference/block-kit/blocks#rich_text
func BuildRichTextElement ¶ added in v0.12.0
BuildRichTextElement creates a rich text element
func BuildRichTextInput ¶ added in v0.12.0
func BuildRichTextInput(actionID, placeholder string, initialValue string, focusOnLoad bool) map[string]any
BuildRichTextInput creates a rich text input field Reference: https://api.slack.com/reference/block-kit/block-elements#rich-text-input-element
func BuildRichTextList ¶ added in v0.12.0
BuildRichTextList creates a rich_text_list element Reference: https://api.slack.com/reference/block-kit/block-elements#rich_text_list
func BuildRichTextPreformatted ¶ added in v0.12.0
BuildRichTextPreformatted creates a rich_text_preformatted element
func BuildRichTextQuote ¶ added in v0.12.0
BuildRichTextQuote creates a rich_text_quote element
func BuildRichTextRange ¶ added in v0.12.0
BuildRichTextRange creates a rich text range for styling
func BuildRichTextSection ¶ added in v0.12.0
BuildRichTextSection creates a rich_text section element
func BuildRichTextSectionBold ¶ added in v0.12.0
BuildRichTextSectionBold creates bold text element for rich_text_section
func BuildRichTextSectionCode ¶ added in v0.12.0
BuildRichTextSectionCode creates code text element for rich_text_section
func BuildRichTextSectionItalic ¶ added in v0.12.0
BuildRichTextSectionItalic creates italic text element for rich_text_section
func BuildRichTextSectionLink ¶ added in v0.12.0
BuildRichTextSectionLink creates link text element for rich_text_section
func BuildRichTextSectionText ¶ added in v0.12.0
BuildRichTextSectionText creates text element for rich_text_section
func BuildSectionBlock ¶ added in v0.12.0
func BuildSectionBlock(text string, fields []map[string]any, accessory map[string]any) []map[string]any
BuildSectionBlock creates a section block with text Reference: https://api.slack.com/reference/block-kit/blocks#section
func BuildSectionBlockWithFields ¶ added in v0.12.0
BuildSectionBlockWithFields creates a section block with only fields (no text)
func BuildSelectionBlock ¶ added in v0.12.0
func BuildSelectionBlock(title string, options []SelectionOption) []map[string]interface{}
BuildSelectionBlock creates a block with selection buttons. Used for: multi-choice prompts.
func BuildSlackFileObject ¶ added in v0.12.0
BuildSlackFileObject creates a slack_file composition object
func BuildStaticSelect ¶ added in v0.12.0
func BuildStaticSelect(options []map[string]any, placeholder, actionID string, initialOption map[string]any) map[string]any
BuildStaticSelect creates a static select menu
func BuildStyleObject ¶ added in v0.12.0
BuildStyleObject creates a style object for rich text
func BuildTableBlock ¶ added in v0.12.0
BuildTableBlock creates a table block for displaying tabular data Reference: https://api.slack.com/reference/block-kit/blocks#table-block
func BuildTaskCardBlock ¶ added in v0.12.0
func BuildTaskCardBlock(title, description, assignee, dueDate, status string, actions []map[string]any) []map[string]any
BuildTaskCardBlock creates a task card block for task management Reference: https://api.slack.com/reference/block-kit/blocks#task-card-block
func BuildTriggerObject ¶ added in v0.12.0
BuildTriggerObject creates a trigger composition object
func BuildURLSource ¶ added in v0.12.0
BuildURLSource creates a URL source element for external data Reference: https://api.slack.com/reference/block-kit/block-elements#url-source-element SECURITY: Validates URL scheme to prevent SSRF and XSS attacks
func BuildURLSourceUnsafe ¶ added in v0.12.0
BuildURLSourceUnsafe creates a URL source element without validation (use with caution) Only use this when you have already validated the URL through other means
func BuildUserMention ¶ added in v0.12.0
BuildUserMention creates a user mention for rich_text_section
func BuildVideoBlock ¶ added in v0.12.0
func BuildVideoBlock(videoURL, thumbnailURL, title, description string, authorName, providerName string) []map[string]any
BuildVideoBlock creates a video block (for apps with video permissions) Reference: https://api.slack.com/reference/block-kit/blocks#video
func BuildWorkflowButton ¶ added in v0.12.0
BuildWorkflowButton creates a button that triggers a Slack workflow Reference: https://api.slack.com/reference/block-kit/block-elements#workflow-button-element
func BuildWorkflowObject ¶ added in v0.12.0
BuildWorkflowObject creates a workflow composition object
func ChunkMessageMarkdown ¶ added in v0.12.0
chunkMessageMarkdown splits a markdown message into chunks, keeping code blocks together as much as possible.
func FormatChannelAllMention ¶ added in v0.12.0
func FormatChannelAllMention() string
FormatChannelMention creates a @channel mention
func FormatChannelMention ¶ added in v0.12.0
FormatChannelMention creates a channel mention: <#C123|channel-name>
func FormatChannelMentionByID ¶ added in v0.12.0
FormatChannelMentionByID creates a channel mention with just ID: <#C123>
func FormatCommand ¶ added in v0.12.0
FormatCommand creates a command formatting
func FormatDate ¶ added in v0.12.0
FormatDate creates a simple date formatting
func FormatDateLong ¶ added in v0.12.0
FormatDateLong creates a long date formatting (e.g., "Monday, January 1, 2024")
func FormatDateShort ¶ added in v0.12.0
FormatDateShort creates a short date formatting (e.g., "Jan 1, 2024")
func FormatDateTime ¶ added in v0.12.0
FormatDateTime creates a date formatting: <!date^timestamp^format|fallback> Reference: https://api.slack.com/reference/surfaces/formatting#date-formatting
func FormatDateTimeCombined ¶ added in v0.12.0
FormatDateTimeCombined creates combined date and time formatting
func FormatDateTimeWithLink ¶ added in v0.12.0
FormatDateTimeWithLink creates a date formatting with link: <!date^timestamp^format^link|fallback>
func FormatEmail ¶ added in v0.12.0
FormatEmail creates an email link
func FormatEveryoneMention ¶ added in v0.12.0
func FormatEveryoneMention() string
FormatEveryoneMention creates a @everyone mention
func FormatHereMention ¶ added in v0.12.0
func FormatHereMention() string
FormatHereMention creates a @here mention
func FormatObject ¶ added in v0.12.0
FormatObject creates an object mention (for boards, clips, etc.)
func FormatSpecialMention ¶ added in v0.12.0
FormatSpecialMention creates a special mention: <!here>, <!channel>, <!everyone>
func FormatSubteamMention ¶ added in v0.12.0
FormatSubteamMention creates a user group mention: <!subteam^S123|@group>
func FormatTime ¶ added in v0.12.0
FormatTime creates a time formatting (e.g., "2:30 PM")
func FormatUserMention ¶ added in v0.12.0
FormatUserMention creates a user mention: <@U123|username>
func FormatUserMentionByID ¶ added in v0.12.0
FormatUserMentionByID creates a user mention with just ID: <@U123>
func IsAllowedScheme ¶ added in v0.12.0
IsAllowedScheme checks if a URL scheme is in the allowed list
func NewContextWithTraceID ¶ added in v0.12.0
NewContextWithTraceID creates a new context with a generated trace ID Returns the context and the trace ID
func RateLimitKey ¶ added in v0.12.0
RateLimitKey generates a rate limit key based on user ID and IP
func SanitizeCommand ¶ added in v0.12.0
SanitizeCommand sanitizes command string for safe display in code blocks
func SanitizeErrorMessage ¶ added in v0.12.0
SanitizeErrorMessage removes potentially sensitive information from error messages
func SanitizeForDisplay ¶ added in v0.12.0
SanitizeForDisplay removes potentially dangerous content for display
func SanitizeForRegex ¶ added in v0.12.0
SanitizeForRegex escapes special regex characters in user input
func SanitizeMarkdown ¶ added in v0.12.0
SanitizeMarkdown removes potentially dangerous markdown patterns
func TraceIDFromContext ¶ added in v0.12.0
TraceIDFromContext extracts the trace ID from context
func TruncateByRune ¶ added in v0.12.0
TruncateByRune truncates string by rune count, not byte count
func TruncateMrkdwn ¶ added in v0.12.0
TruncateMrkdwn truncates mrkdwn text to max length while preserving formatting It avoids cutting in the middle of code blocks or special syntax
func TruncateText ¶ added in v0.12.0
TruncateText truncates text to max length with ellipsis
func ValidateAccessibilityLabel ¶ added in v0.12.0
ValidateAccessibilityLabel validates accessibility label for button (max 75 chars)
func ValidateActionID ¶ added in v0.12.0
ValidateActionID validates action_id format
func ValidateAndTruncateBlocks ¶ added in v0.12.0
ValidateAndTruncateBlocks validates blocks and truncates if necessary
func ValidateBlock ¶ added in v0.12.0
ValidateBlock validates a single block
func ValidateBlockID ¶ added in v0.12.0
ValidateBlockID validates block_id length
func ValidateBlockWithDetails ¶ added in v0.12.0
ValidateBlockWithDetails returns detailed validation errors
func ValidateBlocks ¶ added in v0.12.0
ValidateBlocks validates an array of blocks
func ValidateButtonComplete ¶ added in v0.12.0
ValidateButtonComplete performs complete validation for button element
func ValidateButtonURL ¶ added in v0.12.0
ValidateButtonURL validates URL for button elements
func ValidateButtonURLLength ¶ added in v0.12.0
ValidateButtonURLLength validates button URL length (max 3000 chars)
func ValidateButtonValue ¶ added in v0.12.0
ValidateButtonValue validates permission button value format Returns (behavior, sessionID, messageID, error)
func ValidateComplete ¶ added in v0.12.0
ValidateComplete validates all fields in a block for comprehensive validation
func ValidateConfirmationDialog ¶ added in v0.12.0
func ValidateConfirmationDialog(title, text, confirmText, denyText string) (string, string, string, string)
ValidateConfirmationDialog validates confirmation dialog fields
func ValidateConfirmationDialogText ¶ added in v0.12.0
func ValidateConfirmationDialogText(title, text, confirmText, denyText string) (string, string, string, string)
ValidateConfirmationDialogText validates confirmation dialog text fields
func ValidateEmailFormat ¶ added in v0.12.0
ValidateEmailFormat performs basic email validation
func ValidateEmoji ¶ added in v0.12.0
ValidateEmoji validates and optionally removes emoji from text
func ValidateFileComplete ¶ added in v0.12.0
ValidateFileComplete performs complete validation for file block
func ValidateFileInput ¶ added in v0.12.0
ValidateFileInput validates file input element
func ValidateImageComplete ¶ added in v0.12.0
ValidateImageComplete performs complete validation for image block
func ValidateImageURL ¶ added in v0.12.0
ValidateImageURL validates URL for image blocks
func ValidateInitialValue ¶ added in v0.12.0
ValidateInitialValue validates initial_value for input elements
func ValidateInitialValueForInput ¶ added in v0.12.0
ValidateInitialValueForInput validates initial_value for input elements
func ValidateMentionFormat ¶ added in v0.12.0
ValidateMentionFormat validates Slack mention format
func ValidateMrkdwnText ¶ added in v0.12.0
ValidateMrkdwnText validates mrkdwn text content
func ValidateOptionValue ¶ added in v0.12.0
ValidateOptionValue validates option value in select menus
func ValidatePlainText ¶ added in v0.12.0
ValidatePlainText validates plain_text object content
func ValidatePlanBlock ¶ added in v0.12.0
ValidatePlanBlock validates plan block
func ValidateRegexPattern ¶ added in v0.12.0
ValidateRegexPattern validates regex pattern to prevent ReDoS
func ValidateRichTextInput ¶ added in v0.12.0
ValidateRichTextInput validates rich text input element
func ValidateTableBlock ¶ added in v0.12.0
ValidateTableBlock validates table block
func ValidateTaskCardBlock ¶ added in v0.12.0
ValidateTaskCardBlock validates task card block
func ValidateTextObject ¶ added in v0.12.0
ValidateTextObject validates a text object
func ValidateTokenFormat ¶ added in v0.12.0
ValidateTokenFormat validates Slack token format with safe regex
func ValidateToolName ¶ added in v0.12.0
ValidateToolName validates tool name for safe display
func ValidateURL ¶ added in v0.12.0
ValidateURL checks if a URL uses an allowed scheme
func ValidateURLFormat ¶ added in v0.12.0
ValidateURLFormat performs basic URL validation
func WithFocusOnLoad ¶ added in v0.12.0
BuildFocusOnLoad sets focus on an input element when a modal loads
Types ¶
type Adapter ¶
func NewAdapter ¶
func (*Adapter) AddReaction ¶ added in v0.11.1
AddReaction adds a reaction to a message
func (*Adapter) SendAttachment ¶
func (a *Adapter) SendAttachment(ctx context.Context, channelID, threadTS string, attachment base.Attachment) error
SendAttachment sends an attachment to a Slack channel
func (*Adapter) SendMessage ¶
func (*Adapter) SendMessageWithOptions ¶
func (a *Adapter) SendMessageWithOptions(ctx context.Context, sessionID string, msg *MessageContent, opts SendMessageOptions) error
SendMessageWithOptions sends a message with full options support This includes: message chunking, thread support, rate limiting
func (*Adapter) SendToChannel ¶
func (*Adapter) SetEngine ¶ added in v0.12.0
SetEngine sets the engine for the adapter (used for slash commands)
func (*Adapter) SetSlashCommandHandler ¶ added in v0.11.1
func (a *Adapter) SetSlashCommandHandler(fn func(cmd SlashCommand))
SetSlashCommandHandler sets the handler for slash commands
func (*Adapter) Start ¶
Start starts the adapter (overrides base.Adapter.Start to support Socket Mode)
func (*Adapter) UpdateMessage ¶ added in v0.12.0
func (a *Adapter) UpdateMessage(ctx context.Context, channelID, messageTS string, blocks []any, fallbackText string) error
UpdateMessage updates an existing Slack message using chat.update API Used for streaming AI responses with "typing indicator" UX
type BlockBuilder ¶ added in v0.12.0
type BlockBuilder struct{}
BlockBuilder builds Slack Block Kit messages for various event types
func NewBlockBuilder ¶ added in v0.12.0
func NewBlockBuilder() *BlockBuilder
NewBlockBuilder creates a new BlockBuilder instance
func (*BlockBuilder) BuildAnswerBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildAnswerBlock(content string) []map[string]any
BuildAnswerBlock builds a section block for AI answer text Used for: provider.EventTypeAnswer Strategy: Stream updates via chat.update, supports mrkdwn formatting
func (*BlockBuilder) BuildChunkedAnswerBlocks ¶ added in v0.12.0
func (b *BlockBuilder) BuildChunkedAnswerBlocks(content string) [][]map[string]any
BuildChunkedAnswerBlocks builds answer blocks with automatic chunking If content exceeds SlackTextLimit, it will be split into multiple blocks
func (*BlockBuilder) BuildChunkedSectionBlocks ¶ added in v0.12.0
func (b *BlockBuilder) BuildChunkedSectionBlocks(text string) [][]map[string]any
BuildChunkedSectionBlocks builds section blocks with automatic chunking
func (*BlockBuilder) BuildDividerBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildDividerBlock() []map[string]any
BuildDividerBlock creates a simple divider
func (*BlockBuilder) BuildErrorBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildErrorBlock(message string, isDangerBlock bool) []map[string]any
BuildErrorBlock builds blocks for error messages Used for: provider.EventTypeError, danger_block Strategy: Send immediately (not aggregated) for critical feedback
func (*BlockBuilder) BuildSessionStatsBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildSessionStatsBlock(stats *event.SessionStatsData, style SessionStatsStyle) []map[string]any
BuildSessionStatsBlock builds a rich statistics summary block Used for: session_stats events at end of each turn Strategy: Send as final summary with visual polish
func (*BlockBuilder) BuildStatsBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildStatsBlock(stats *event.EventMeta) []map[string]any
BuildStatsBlock builds a section block with statistics Used for: provider.EventTypeResult (end of turn) Strategy: Send as final summary
func (*BlockBuilder) BuildThinkingBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildThinkingBlock(content string) []map[string]any
BuildThinkingBlock builds a context block for thinking status Used for: provider.EventTypeThinking Strategy: Send immediately (not aggregated) for instant feedback
func (*BlockBuilder) BuildToolResultBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildToolResultBlock(success bool, durationMs int64, output string, hasButton bool) []map[string]any
BuildToolResultBlock builds a section block for tool execution result Used for: provider.EventTypeToolResult Strategy: Can be aggregated, includes optional button to expand output
func (*BlockBuilder) BuildToolUseBlock ¶ added in v0.12.0
func (b *BlockBuilder) BuildToolUseBlock(toolName, input string, truncated bool) []map[string]any
BuildToolUseBlock builds a section block for tool invocation Used for: provider.EventTypeToolUse Strategy: Can be aggregated with similar tool events
type CallbackChannel ¶ added in v0.12.0
CallbackChannel represents the channel in a Slack callback.
type CallbackMessage ¶ added in v0.12.0
type CallbackMessage struct {
Ts string `json:"ts"`
Type string `json:"type"`
Text string `json:"text"`
}
CallbackMessage represents the message in a Slack callback.
type CallbackTeam ¶ added in v0.12.0
CallbackTeam represents the team in a Slack callback.
type CallbackUser ¶ added in v0.12.0
CallbackUser represents the user in a Slack callback.
type Config ¶
type Config struct {
BotToken string
AppToken string
SigningSecret string
SystemPrompt string
// Mode: "http" (default) or "socket" for WebSocket connection
Mode string
// ServerAddr: HTTP server address (e.g., ":8080")
ServerAddr string
// Permission Policy for Direct Messages
// "allow" - Allow all DMs (default)
// "pairing" - Only allow when user is paired
// "block" - Block all DMs
DMPolicy string
// Permission Policy for Group Messages
// "allow" - Allow all group messages (default)
// "mention" - Only allow when bot is mentioned
// "block" - Block all group messages
GroupPolicy string
// AllowedUsers: List of user IDs who can interact with the bot (whitelist)
AllowedUsers []string
// BlockedUsers: List of user IDs who cannot interact with the bot (blacklist)
BlockedUsers []string
// BotUserID: Bot's user ID (e.g., "U1234567890") - used for mention detection
BotUserID string
// SlashCommandRateLimit: Maximum requests per second per user for slash commands
// Default: 10.0 requests/second
SlashCommandRateLimit float64
// contains filtered or unexported fields
}
func (*Config) ContainsBotMention ¶ added in v0.12.0
ContainsBotMention checks if message text contains a bot mention Slack mention format: <@U1234567890> or <!here> or <!channel> Uses regex for exact matching to prevent false positives
func (*Config) IsSocketMode ¶
IsSocketMode returns true if Socket Mode is enabled
func (*Config) IsUserAllowed ¶ added in v0.12.0
IsUserAllowed checks if a user is allowed to interact with the bot
func (*Config) MarkPaired ¶ added in v0.12.0
MarkPaired marks a user as having an active DM with the bot
func (*Config) ShouldProcessChannel ¶ added in v0.12.0
ShouldProcessChannel checks if messages from a channel should be processed channelType: "dm" or "channel" or "group"
type ErrorClass ¶ added in v0.12.0
type ErrorClass int
ErrorClass classifies Slack API errors for handling decisions
const ( // Retryable - errors that should be retried with backoff Retryable ErrorClass = iota // Fatal - errors that should not be retried (auth, invalid, etc.) Fatal // UserError - errors that indicate user action needed (channel not found, etc.) UserError // Unknown - errors that are not recognized, default to retry Unknown )
func GetErrorClass ¶ added in v0.12.0
func GetErrorClass(err error) ErrorClass
GetErrorClass returns the ErrorClass for a given error
type EventHandler ¶
type EventHandler func(eventType string, data json.RawMessage)
EventHandler handles incoming Slack events
type MessageContent ¶
type MessageContent struct {
Content string
}
MessageContent represents the content of a message to send
type MessageEvent ¶
type MessageEvent struct {
Type string `json:"type"`
Channel string `json:"channel"`
ChannelType string `json:"channel_type"`
User string `json:"user"`
Text string `json:"text"`
TS string `json:"ts"`
EventTS string `json:"event_ts"`
BotID string `json:"bot_id,omitempty"`
SubType string `json:"subtype,omitempty"`
ThreadTS string `json:"thread_ts,omitempty"` // Thread identifier
ParentUser string `json:"parent_user_id,omitempty"` // Parent message user
BotUserID string `json:"bot_user_id,omitempty"` // Bot user ID for mentions
}
type MrkdwnFormatter ¶ added in v0.12.0
type MrkdwnFormatter struct{}
MrkdwnFormatter provides utilities for converting Markdown to Slack mrkdwn format
func NewMrkdwnFormatter ¶ added in v0.12.0
func NewMrkdwnFormatter() *MrkdwnFormatter
NewMrkdwnFormatter creates a new MrkdwnFormatter
func (*MrkdwnFormatter) Format ¶ added in v0.12.0
func (f *MrkdwnFormatter) Format(text string) string
Format converts Markdown text to Slack mrkdwn format Handles: bold, italic, strikethrough, code blocks, links Order: links -> bold -> italic -> strikethrough -> escape (to preserve URLs and code)
func (*MrkdwnFormatter) FormatCodeBlock ¶ added in v0.12.0
func (f *MrkdwnFormatter) FormatCodeBlock(code, language string) string
FormatCodeBlock formats code with optional language hint
type RateLimitError ¶ added in v0.12.0
RateLimitError represents a rate limit error with retry-after information
func (*RateLimitError) Error ¶ added in v0.12.0
func (e *RateLimitError) Error() string
type RetryConfig ¶
RetryConfig configures the retry behavior
type SelectionOption ¶ added in v0.12.0
SelectionOption represents an option for selection buttons.
type SendMessageOptions ¶
type SendMessageOptions struct {
ChannelID string
ThreadTS string
Markdown bool // Whether to convert markdown to mrkdwn
}
SendMessageOptions contains options for sending messages
type SessionStatsStyle ¶ added in v0.12.0
type SessionStatsStyle string
SessionStatsStyle defines the visual style for session statistics
const ( // StatsStyleCompact - Minimal single-line summary StatsStyleCompact SessionStatsStyle = "compact" // StatsStyleCard - Rich card with emoji indicators (recommended) StatsStyleCard SessionStatsStyle = "card" // StatsStyleDetailed - Full breakdown with all metrics StatsStyleDetailed SessionStatsStyle = "detailed" )
type SlackAction ¶ added in v0.12.0
type SlackAction struct {
ActionID string `json:"action_id"`
BlockID string `json:"block_id"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Value string `json:"value"`
Style string `json:"style"`
}
SlackAction represents an action within a Slack interaction callback.
type SlackInteractionCallback ¶ added in v0.12.0
type SlackInteractionCallback struct {
Type string `json:"type"`
User CallbackUser `json:"user"`
Channel CallbackChannel `json:"channel"`
Message CallbackMessage `json:"message"`
ResponseURL string `json:"response_url"`
TriggerID string `json:"trigger_id"`
Actions []SlackAction `json:"actions"`
Team CallbackTeam `json:"team"`
}
SlackInteractionCallback represents a Slack interaction callback payload.
type SlashCommand ¶ added in v0.11.1
type SlashCommand struct {
Command string
Text string
UserID string
ChannelID string
ResponseURL string
}
SlashCommand represents a Slack slash command
type SlashCommandRateLimiter ¶ added in v0.12.0
type SlashCommandRateLimiter struct {
// contains filtered or unexported fields
}
SlashCommandRateLimiter provides per-user rate limiting using token bucket algorithm
func NewSlashCommandRateLimiter ¶ added in v0.12.0
func NewSlashCommandRateLimiter() *SlashCommandRateLimiter
NewSlashCommandRateLimiter creates a new rate limiter with default settings
func NewSlashCommandRateLimiterWithConfig ¶ added in v0.12.0
func NewSlashCommandRateLimiterWithConfig(rps float64, burst int) *SlashCommandRateLimiter
NewSlashCommandRateLimiterWithConfig creates a new rate limiter with custom settings If rps is 0 or negative, defaultRateLimit will be used
func (*SlashCommandRateLimiter) Allow ¶ added in v0.12.0
func (r *SlashCommandRateLimiter) Allow(userID string) bool
Allow checks if a request from the given user is allowed Returns true if the request is within rate limit, false if rate limited
func (*SlashCommandRateLimiter) Stop ¶ added in v0.12.0
func (r *SlashCommandRateLimiter) Stop()
Stop gracefully stops the rate limiter cleanup goroutine
type SocketModeConfig ¶
SocketModeConfig holds configuration for Socket Mode connection
type SocketModeConnection ¶
type SocketModeConnection struct {
// contains filtered or unexported fields
}
SocketModeConnection manages a WebSocket connection to Slack's Socket Mode
func NewSocketModeConnection ¶
func NewSocketModeConnection(config SocketModeConfig, logger *slog.Logger) *SocketModeConnection
NewSocketModeConnection creates a new Socket Mode connection
func (*SocketModeConnection) IsConnected ¶
func (s *SocketModeConnection) IsConnected() bool
IsConnected returns true if the connection is active
func (*SocketModeConnection) RegisterHandler ¶
func (s *SocketModeConnection) RegisterHandler(eventType string, handler EventHandler)
RegisterHandler registers an event handler for a specific event type
func (*SocketModeConnection) Send ¶
func (s *SocketModeConnection) Send(data map[string]any) error
Send sends a message over the WebSocket connection
func (*SocketModeConnection) SetReconnectCallbacks ¶ added in v0.11.2
func (s *SocketModeConnection) SetReconnectCallbacks(onReconnect func(), onReconnectFail func(error))
SetReconnectCallbacks sets callbacks for reconnection events
func (*SocketModeConnection) Start ¶
func (s *SocketModeConnection) Start(ctx context.Context) error
Start begins the Socket Mode connection
func (*SocketModeConnection) Stop ¶
func (s *SocketModeConnection) Stop() error
Stop closes the Socket Mode connection
type ValidationError ¶ added in v0.12.0
ValidationError represents a block validation error
func (*ValidationError) Error ¶ added in v0.12.0
func (e *ValidationError) Error() string