slack

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package slack provides a Slack provider for omnichat using Socket Mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BotToken is the Slack bot token (xoxb-...).
	BotToken string

	// AppToken is the Slack app-level token for Socket Mode (xapp-...).
	AppToken string

	// Logger is the logger instance.
	Logger *slog.Logger

	// Debug enables debug logging for the Slack client.
	Debug bool
}

Config configures the Slack provider.

type Provider

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

Provider implements the Provider interface for Slack.

func New

func New(config Config) (*Provider, error)

New creates a new Slack provider.

func (*Provider) Connect

func (p *Provider) Connect(ctx context.Context) error

Connect establishes connection to Slack via Socket Mode.

func (*Provider) Disconnect

func (p *Provider) Disconnect(ctx context.Context) error

Disconnect closes the Slack connection.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) OnEvent

func (p *Provider) OnEvent(handler provider.EventHandler)

OnEvent registers an event handler.

func (*Provider) OnMessage

func (p *Provider) OnMessage(handler provider.MessageHandler)

OnMessage registers a message handler.

func (*Provider) Send

func (p *Provider) Send(ctx context.Context, channelID string, msg provider.OutgoingMessage) error

Send sends a message to a Slack channel.

Jump to

Keyboard shortcuts

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