slack

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package slack provides a Slack bot interface for Chronos agents.

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 is a Slack bot that receives messages and routes them to an agent.

func New

func New(token, signingKey string, handler MessageHandler) *Bot

New creates a new Slack bot. token is the Slack Bot OAuth token. signingKey is the Slack signing secret for request verification. handler is called for each incoming message.

func (*Bot) PostMessage

func (b *Bot) PostMessage(ctx context.Context, channel, text, threadTS string) error

PostMessage sends a message to a Slack channel.

func (*Bot) ServeHTTP

func (b *Bot) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles incoming Slack Events API requests.

func (*Bot) Start

func (b *Bot) Start(ctx context.Context, addr string) error

Start begins serving the Slack Events API on the given address.

func (*Bot) Stop

func (b *Bot) Stop() error

Stop gracefully shuts down the bot server.

type MessageHandler

type MessageHandler func(ctx context.Context, channel, user, text, threadTS string) (string, error)

MessageHandler processes incoming messages and returns a response.

Jump to

Keyboard shortcuts

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