slack

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package slack provides Slack integration via Socket Mode

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles Slack communication

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new Slack client

func (*Client) AddReaction

func (c *Client) AddReaction(channel, timestamp, emoji string) error

AddReaction adds a reaction to a message

func (*Client) PostMessage

func (c *Client) PostMessage(channel, text, threadTS string) error

PostMessage sends a message to a channel

func (*Client) PostMessageAsAgent

func (c *Client) PostMessageAsAgent(channel, agentName, text, threadTS string) error

PostMessageAsAgent sends a message with agent identity

func (*Client) Run

func (c *Client) Run() error

Run starts the socket mode client (blocking)

func (*Client) Start

func (c *Client) Start(ctx context.Context, handler func([]*IncomingMessage))

Start begins listening for Slack events

type Config

type Config struct {
	BotToken    string
	AppToken    string
	WaitSeconds int // Wait time before processing (default 120)
}

Config holds Slack configuration

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler processes Slack messages with the AI team

func NewHandler

func NewHandler(client *Client, agents *agent.Agents, logMgr *logger.Manager, workDir string) *Handler

NewHandler creates a new Slack message handler

func (*Handler) HandleMessages

func (h *Handler) HandleMessages(msgs []*IncomingMessage)

HandleMessages processes a batch of messages from a customer

type IncomingMessage

type IncomingMessage struct {
	Channel     string
	User        string
	UserName    string
	Text        string
	Timestamp   string
	ThreadTS    string
	IsFromBot   bool   // true if message is from a bot (agent)
	SenderAgent string // agent name if from bot (e.g., "Mei Chen")
}

IncomingMessage represents a message from Slack

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL